We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b451cf commit fa3ce61Copy full SHA for fa3ce61
1 file changed
cpp/ql/test/experimental/query-tests/Security/CWE/CWE-754/semmle/tests/test.cpp
@@ -119,3 +119,10 @@ int functionWork3b(int i) {
119
scanf("%i", &i); // BAD
120
return 0;
121
}
122
+int functionWork3() {
123
+ char number[] = "42";
124
+ int d;
125
+ sscanf(number, "%d", &d); // GOOD: sscanf always succeeds
126
+ if (d < 16)
127
+ return -1;
128
+}
0 commit comments