File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
cpp/ql/test/query-tests/Security/CWE/CWE-120/semmle/tests Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 23
23
| varbuffer.c:16:5:16:10 | call to strcpy | This 'call to strcpy' operation requires 10 bytes but the destination is only 1 bytes. |
24
24
| varbuffer.c:23:5:23:10 | call to strcpy | This 'call to strcpy' operation requires 12 bytes but the destination is only 11 bytes. |
25
25
| varbuffer.c:24:5:24:10 | call to strcpy | This 'call to strcpy' operation requires 17 bytes but the destination is only 11 bytes. |
26
- | varbuffer.c:39:5:39:10 | call to strcpy | This 'call to strcpy' operation requires 3 bytes but the destination is only 2 bytes. |
27
- | varbuffer.c:40:5:40:10 | call to strcpy | This 'call to strcpy' operation requires 10 bytes but the destination is only 2 bytes. |
28
- | varbuffer.c:45:5:45:10 | call to strcpy | This 'call to strcpy' operation requires 10 bytes but the destination is only 2 bytes. |
29
- | varbuffer.c:46:5:46:10 | call to strcpy | This 'call to strcpy' operation requires 17 bytes but the destination is only 2 bytes. |
26
+ | varbuffer.c:40:5:40:10 | call to strcpy | This 'call to strcpy' operation requires 10 bytes but the destination is only 4 bytes. |
27
+ | varbuffer.c:45:5:45:10 | call to strcpy | This 'call to strcpy' operation requires 10 bytes but the destination is only 4 bytes. |
28
+ | varbuffer.c:46:5:46:10 | call to strcpy | This 'call to strcpy' operation requires 17 bytes but the destination is only 4 bytes. |
30
29
| varbuffer.c:60:5:60:10 | call to strcpy | This 'call to strcpy' operation requires 2 bytes but the destination is only 1 bytes. |
31
30
| varbuffer.c:61:5:61:10 | call to strcpy | This 'call to strcpy' operation requires 10 bytes but the destination is only 1 bytes. |
32
31
| varbuffer.c:67:5:67:10 | call to strcpy | This 'call to strcpy' operation requires 17 bytes but the destination is only 11 bytes. |
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ void testMyFixedStruct()
36
36
ptr1 -> len = 1 ;
37
37
strcpy (ptr1 -> buffer , "" ); // GOOD
38
38
strcpy (ptr1 -> buffer , "1" ); // GOOD
39
- strcpy (ptr1 -> buffer , "12" ); // BAD: length 3, but destination only has length 2
39
+ strcpy (ptr1 -> buffer , "12" ); // BAD: length 3, but destination only has length 2 [NOT DETECTED]
40
40
strcpy (ptr1 -> buffer , "123456789" ); // BAD: length 10, but destination only has length 2
41
41
// ...
42
42
You can’t perform that action at this time.
0 commit comments