Using CodeQL for Data Flow Analysis and Visualization #15982
Replies: 3 comments 9 replies
-
|
Do you care about interprocedural flows, or only within a single procedure? |
Beta Was this translation helpful? Give feedback.
-
This helped a lot, thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Try this: Now for whatever reason while So without |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
My team and I have been experimenting with CodeQL for some time, and we need some guidance on filtering CodeQL's data flow analysis results and on using the graph making capabilities.
Below is the query we have come up with. It traces flow from a function parameter and its fields to any sink:
Here is some minimal code that you can run the query on to produce results.
Issues
status.statusand end atif (! status_bit) return;In addition, there are multiple flows that start and end atif (! tx_bit) return;There are many more such examples. How can we refine this query to reduce/eliminate duplicates?statusparameter ->status_bit->ifconditionstatusparameter ->tx_bit->ifcondition@kind graphquery and then view the output as a visual graph (perhaps use bqrs interpret to convert the raw query output to adotfile). How can we go about doing this? We have seen How to use @kind graph query? #7437, but were not able to make much sense of it and documentation is scarce.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions