File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
cpp/ql/test/query-tests/Security/CWE/CWE-120/semmle/tests Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -175,11 +175,11 @@ void tesHexBounds(int x) {
175
175
char buffer3 [3 ];
176
176
char buffer5 [5 ];
177
177
178
- sprintf (buffer2 , "%x" , 1 ); // GOOD [FALSE POSITIVE]
179
- sprintf (buffer3 , "%x" , 16 ); // GOOD [FALSE POSITIVE]
180
- sprintf (buffer5 , "%x" , (unsigned short )x ); // GOOD: bounded by conversion [FALSE POSITIVE]
178
+ sprintf (buffer2 , "%x" , 1 ); // GOOD
179
+ sprintf (buffer3 , "%x" , 16 ); // GOOD
180
+ sprintf (buffer5 , "%x" , (unsigned short )x ); // GOOD: bounded by conversion
181
181
if (x < 16 && x > 0 ) {
182
- sprintf (buffer2 , "%x" , x ); // GOOD: bounded by check [FALSE POSITIVE]
182
+ sprintf (buffer2 , "%x" , x ); // GOOD: bounded by check
183
183
}
184
184
185
185
if (x < 16 ) {
@@ -190,6 +190,6 @@ void tesHexBounds(int x) {
190
190
}
191
191
192
192
if (x < 0x10000 && x > 0 ) {
193
- sprintf (buffer5 , "%x" , x ); // GOOD: bounded by check [FALSE POSITIVE]
193
+ sprintf (buffer5 , "%x" , x ); // GOOD: bounded by check
194
194
}
195
195
}
You can’t perform that action at this time.
0 commit comments