File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
cpp/ql/test/experimental/query-tests/Security/CWE/CWE-754/semmle/tests Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,9 @@ int functionWork2() {
5151 char a[10 ] = " " ;
5252 int b = 1 ;
5353 int *p = &b;
54- scanf (" %i" , &i); // GOOD:the error can be determined by examining the initial value .
55- scanf (" %s" , a); // GOOD:the error can be determined by examining the initial value .
56- scanf (" %i" , p); // GOOD:the error can be determined by examining the initial value .
54+ scanf (" %i" , &i); // GOOD:Argument initialized even when scanf fails .
55+ scanf (" %s" , a); // GOOD:Argument initialized even when scanf fails .
56+ scanf (" %i" , p); // GOOD:Argument initialized even when scanf fails .
5757 return i;
5858}
5959
@@ -65,9 +65,9 @@ int functionWork2_() {
6565 int b;
6666 b=1 ;
6767 int *p = &b;
68- scanf (" %i" , &i); // GOOD:the error can be determined by examining the initial value .
69- scanf (" %s" , a); // GOOD:the error can be determined by examining the initial value .
70- scanf (" %i" , p); // GOOD:the error can be determined by examining the initial value .
68+ scanf (" %i" , &i); // GOOD:Argument initialized even when scanf fails .
69+ scanf (" %s" , a); // GOOD:Argument initialized even when scanf fails .
70+ scanf (" %i" , p); // GOOD:Argument initialized even when scanf fails .
7171 return i;
7272}
7373int functionWork2b () {
You can’t perform that action at this time.
0 commit comments