Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 547342c commit 2dc85e1Copy full SHA for 2dc85e1
1 file changed
cpp/ql/test/experimental/query-tests/Security/CWE/CWE-754/semmle/tests/test.cpp
@@ -35,14 +35,18 @@ int functionWork1_() {
35
return i;
36
}
37
38
-int functionWork1b() {
+int functionWork1b(int retIndex) {
39
int i;
40
char a[10];
41
int b;
42
int *p = &b;
43
scanf("%i", &i); // BAD
44
scanf("%s", a); // BAD
45
scanf("%i", p); // BAD
46
+ if(retIndex == 0)
47
+ return (int)a;
48
+ if(retIndex == 1)
49
+ return *p;
50
51
52
0 commit comments