File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
src/queries/security/CWE-696
test/query-tests/security/CWE-696 Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -40,16 +40,17 @@ class StdCall extends Expr {
4040class PathElement = AstNode ;
4141
4242query predicate edges ( PathElement pred , PathElement succ ) {
43- // starting edge
43+ // starting edge (`#[ctor]` / `#[dtor]` attribute to call)
4444 exists ( CtorAttr ctor , Function f , CallExprBase call |
4545 f .getAnAttr ( ) = ctor and
4646 call .getEnclosingCallable ( ) = f and
47- pred = ctor and // source
48- succ = call // flow or sink node
47+ pred = ctor and
48+ succ = call
4949 )
5050 or
51- // transitive edge
51+ // transitive edge (call to call)
5252 exists ( Function f |
53+ edges ( _, pred ) and
5354 pred .( CallExprBase ) .getStaticTarget ( ) = f and
5455 succ .( CallExprBase ) .getEnclosingCallable ( ) = f
5556 )
Original file line number Diff line number Diff line change 5050| test.rs:147:5:147:20 | call_target3_1(...) | test.rs:126:9:126:16 | stderr(...) |
5151| test.rs:147:5:147:20 | call_target3_1(...) | test.rs:126:9:126:44 | ... .write_all(...) |
5252| test.rs:151:1:151:7 | Attr | test.rs:153:5:153:12 | bad3_3(...) |
53- | test.rs:157:5:157:20 | call_target3_1(...) | test.rs:126:9:126:16 | stderr(...) |
54- | test.rs:157:5:157:20 | call_target3_1(...) | test.rs:126:9:126:44 | ... .write_all(...) |
5553| test.rs:169:1:169:7 | Attr | test.rs:171:5:171:15 | ... .write(...) |
5654| test.rs:169:1:169:7 | Attr | test.rs:171:5:171:15 | ...::stdout(...) |
You can’t perform that action at this time.
0 commit comments