Skip to content

Commit eb263e7

Browse files
committed
C++: Make sure the test terminates.
1 parent bc576f6 commit eb263e7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
edges
2+
| main.cpp:6:27:6:30 | argv indirection | main.cpp:10:20:10:23 | argv indirection |
3+
| main.cpp:10:20:10:23 | argv indirection | tests.cpp:618:32:618:35 | argv indirection |
4+
| tests.cpp:613:19:613:24 | source indirection | tests.cpp:615:17:615:22 | source indirection |
5+
| tests.cpp:618:32:618:35 | argv indirection | tests.cpp:643:9:643:15 | access to array indirection |
6+
| tests.cpp:643:9:643:15 | access to array indirection | tests.cpp:613:19:613:24 | source indirection |
27
nodes
8+
| main.cpp:6:27:6:30 | argv indirection | semmle.label | argv indirection |
9+
| main.cpp:10:20:10:23 | argv indirection | semmle.label | argv indirection |
10+
| tests.cpp:613:19:613:24 | source indirection | semmle.label | source indirection |
11+
| tests.cpp:615:17:615:22 | source indirection | semmle.label | source indirection |
12+
| tests.cpp:618:32:618:35 | argv indirection | semmle.label | argv indirection |
13+
| tests.cpp:643:9:643:15 | access to array indirection | semmle.label | access to array indirection |
314
subpaths
415
#select
16+
| tests.cpp:615:2:615:7 | call to strcpy | main.cpp:6:27:6:30 | argv indirection | tests.cpp:615:17:615:22 | source indirection | This 'call to strcpy' with input from $@ may overflow the destination. | main.cpp:6:27:6:30 | argv indirection | a command-line argument |

cpp/ql/test/query-tests/Security/CWE/CWE-119/semmle/tests/tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ void test15()
407407
{
408408
if (ptr[5] == ' ') // GOOD
409409
{
410-
// ...
410+
break;
411411
}
412412
}
413413
}

0 commit comments

Comments
 (0)