File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
src/semmle/code/cpp/dataflow/internal
test/library-tests/dataflow/dataflow-tests Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -735,7 +735,12 @@ private module FieldFlow {
735735 private class FieldConfiguration extends Configuration {
736736 FieldConfiguration ( ) { this = "FieldConfiguration" }
737737
738- override predicate isSource ( Node source ) { storeStep ( source , _, _) }
738+ override predicate isSource ( Node source ) {
739+ storeStep ( source , _, _)
740+ or
741+ // Also mark `foo(a.b);` as a source when `a.b` may be overwritten by `foo`.
742+ readStep ( _, _, any ( Node node | node .asExpr ( ) = source .asDefiningArgument ( ) ) )
743+ }
739744
740745 override predicate isSink ( Node sink ) { readStep ( _, _, sink ) }
741746
Original file line number Diff line number Diff line change 7373| test.cpp:480:67:480:67 | s | test.cpp:481:21:481:21 | s |
7474| test.cpp:480:67:480:67 | s | test.cpp:482:20:482:20 | s |
7575| test.cpp:481:21:481:21 | s [post update] | test.cpp:482:20:482:20 | s |
76+ | test.cpp:481:24:481:30 | ref arg content | test.cpp:482:23:482:29 | content |
7677| test.cpp:482:23:482:29 | content | test.cpp:483:9:483:17 | p_content |
You can’t perform that action at this time.
0 commit comments