Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23eb4d2

Browse files
committed
C++: Fix isParameterDeref typo.
1 parent 75aa1e8 commit 23eb4d2

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

cpp/ql/src/semmle/code/cpp/models/implementations/Strset.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private class StrsetFunction extends ArrayFunction, DataFlowFunction, AliasFunct
3434
(
3535
output.isReturnValueDeref()
3636
or
37-
output.isParameterDeref(1)
37+
output.isParameterDeref(0)
3838
)
3939
or
4040
// flow from the input string to the output string

cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5874,13 +5874,15 @@
58745874
| taint.cpp:504:10:504:12 | ref arg ptr | taint.cpp:505:7:505:9 | ptr | |
58755875
| taint.cpp:504:10:504:12 | ref arg ptr | taint.cpp:506:8:506:10 | ptr | |
58765876
| taint.cpp:504:15:504:20 | source | taint.cpp:504:2:504:8 | call to _strset | TAINT |
5877+
| taint.cpp:504:15:504:20 | source | taint.cpp:504:10:504:12 | ref arg ptr | |
58775878
| taint.cpp:505:7:505:9 | ref arg ptr | taint.cpp:506:8:506:10 | ptr | |
58785879
| taint.cpp:506:8:506:10 | ptr | taint.cpp:506:7:506:10 | * ... | TAINT |
58795880
| taint.cpp:509:26:509:31 | source | taint.cpp:510:10:510:15 | source | |
58805881
| taint.cpp:509:26:509:31 | source | taint.cpp:511:7:511:12 | source | |
58815882
| taint.cpp:510:10:510:15 | ref arg source | taint.cpp:511:7:511:12 | source | |
58825883
| taint.cpp:510:10:510:15 | source | taint.cpp:510:2:510:8 | call to _strset | |
58835884
| taint.cpp:510:18:510:18 | 0 | taint.cpp:510:2:510:8 | call to _strset | TAINT |
5885+
| taint.cpp:510:18:510:18 | 0 | taint.cpp:510:10:510:15 | ref arg source | |
58845886
| vector.cpp:16:43:16:49 | source1 | vector.cpp:17:26:17:32 | source1 | |
58855887
| vector.cpp:16:43:16:49 | source1 | vector.cpp:31:38:31:44 | source1 | |
58865888
| vector.cpp:17:21:17:33 | call to vector | vector.cpp:19:14:19:14 | v | |

cpp/ql/test/library-tests/dataflow/taint-tests/taint.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,8 @@ char *_strset(char *str, int c);
502502

503503
void test_strset_1(char* ptr, char source) {
504504
_strset(ptr, source);
505-
sink(ptr);
506-
sink(*ptr); // $ MISSING: ast,ir
505+
sink(ptr); // $ SPURIOUS: ast,ir
506+
sink(*ptr); // $ ast,ir
507507
}
508508

509509
void test_strset_2(char* source) {

0 commit comments

Comments
 (0)