Skip to content

Commit bc576f6

Browse files
committed
C++: Add a test that fails because of a non-terminating test that dominates this one.
1 parent dc4dda1 commit bc576f6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
edges
2-
subpaths
32
nodes
3+
subpaths
44
#select

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,13 @@ int test23() {
608608
return sizeof(buffer) / sizeof(buffer[101]); // GOOD
609609
}
610610

611+
char* strcpy(char *, const char *);
612+
613+
void test24(char* source) {
614+
char buffer[100];
615+
strcpy(buffer, source); // BAD
616+
}
617+
611618
int tests_main(int argc, char *argv[])
612619
{
613620
long long arr17[19];
@@ -633,6 +640,7 @@ int tests_main(int argc, char *argv[])
633640
test21(argc == 0);
634641
test22(argc == 0, argv[0]);
635642
test23();
643+
test24(argv[0]);
636644

637645
return 0;
638646
}

0 commit comments

Comments
 (0)