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 {
735
735
private class FieldConfiguration extends Configuration {
736
736
FieldConfiguration ( ) { this = "FieldConfiguration" }
737
737
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
+ }
739
744
740
745
override predicate isSink ( Node sink ) { readStep ( _, _, sink ) }
741
746
Original file line number Diff line number Diff line change 73
73
| test.cpp:480:67:480:67 | s | test.cpp:481:21:481:21 | s |
74
74
| test.cpp:480:67:480:67 | s | test.cpp:482:20:482:20 | s |
75
75
| 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 |
76
77
| 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