Skip to content

Using TaintTracking C++ #63

Answered by MathiasVP
assafsion asked this question in General
Discussion options

You must be logged in to vote

The problem is that the statement:

char *tmp_poi = use_me + pos*x

is not an access to the tmp_poi variable (unlike use_me, pos and x which are all variable accesses). Instead, it is a declaration of a local variable. You can verify this for yourself by checking that

from TmpPoiVariableAccess acc
select acc

has 0 results on the snippet you posted.

To capture this path, you can define a TmpPoiVariable class that describes the declaration instead:

class TmpPoiVariable extends LocalVariable {
  TmpPoiVariable() { this.hasName("tmp_poi") }
}

and modify your configuration's isSink to be:

override predicate isSink(DataFlow::Node node) {
  exists(TmpPoiVariable var | node.asExpr() = var.getInitia…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@assafsion
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by nicowaisman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants