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) {
175175 char buffer3 [3 ];
176176 char buffer5 [5 ];
177177
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
181181 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
183183 }
184184
185185 if (x < 16 ) {
@@ -190,6 +190,6 @@ void tesHexBounds(int x) {
190190 }
191191
192192 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
194194 }
195195}
You can’t perform that action at this time.
0 commit comments