Skip to content

Commit a50d5b7

Browse files
committed
Accept changed test output.
1 parent 0ea7fed commit a50d5b7

File tree

8 files changed

+11
-6
lines changed

8 files changed

+11
-6
lines changed

cpp/ql/test/library-tests/allocators/allocators.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ allocationExprs
9191
| allocators.cpp:159:3:159:8 | call to malloc | getSizeExpr = count, getSizeMult = 4, requiresDealloc |
9292
| allocators.cpp:160:3:160:8 | call to malloc | getSizeExpr = ... + ..., getSizeMult = 1, requiresDealloc |
9393
| allocators.cpp:161:3:161:8 | call to malloc | getSizeExpr = count, getSizeMult = 8, requiresDealloc |
94-
| allocators.cpp:162:3:162:8 | call to malloc | getSizeExpr = ... * ..., requiresDealloc |
94+
| allocators.cpp:162:3:162:8 | call to malloc | getSizeBytes = 32, getSizeExpr = ... * ..., getSizeMult = 1, requiresDealloc |
9595
deallocationFunctions
9696
| allocators.cpp:11:6:11:20 | operator delete | getFreedArg = 0 |
9797
| allocators.cpp:12:6:12:22 | operator delete[] | getFreedArg = 0 |
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
| tests1.cpp:26:21:26:26 | call to malloc | This allocation does not include space to null-terminate the string. |
2+
| tests1.cpp:36:21:36:26 | call to malloc | This allocation does not include space to null-terminate the string. |
23
| tests1.cpp:56:21:56:27 | call to realloc | This allocation does not include space to null-terminate the string. |
34
| tests1.cpp:67:21:67:26 | call to malloc | This allocation does not include space to null-terminate the string. |
45
| tests1.cpp:89:25:89:30 | call to malloc | This allocation does not include space to null-terminate the string. |
6+
| tests1.cpp:109:25:109:30 | call to malloc | This allocation does not include space to null-terminate the string. |
57
| tests3.cpp:25:21:25:31 | call to malloc | This allocation does not include space to null-terminate the string. |
68
| tests3.cpp:30:21:30:31 | call to malloc | This allocation does not include space to null-terminate the string. |
79
| tests3.cpp:53:17:53:44 | new[] | This allocation does not include space to null-terminate the string. |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
| tests2.cpp:34:4:34:9 | call to strcat | This buffer only contains enough room for 'str1' (copied on line 33) |
2+
| tests2.cpp:52:4:52:9 | call to strcat | This buffer only contains enough room for 'str1' (copied on line 51) |

cpp/ql/test/query-tests/Critical/OverflowCalculated/tests1.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void tests1(int case_num)
3333
break;
3434

3535
case 3:
36-
buffer = (char *)malloc(strlen(str) * sizeof(char)); // BAD [NOT DETECTED]
36+
buffer = (char *)malloc(strlen(str) * sizeof(char)); // BAD
3737
strcpy(buffer, str);
3838
break;
3939

@@ -106,7 +106,7 @@ void tests1(int case_num)
106106
break;
107107

108108
case 105:
109-
wbuffer = (wchar_t *)malloc(wcslen(wstr) * sizeof(wchar_t)); // BAD [NOT DETECTED]
109+
wbuffer = (wchar_t *)malloc(wcslen(wstr) * sizeof(wchar_t)); // BAD
110110
wcscpy(wbuffer, wstr);
111111
break;
112112

cpp/ql/test/query-tests/Critical/OverflowCalculated/tests2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void tests2(int case_num)
4747
break;
4848

4949
case 4:
50-
buffer = (char *)malloc((strlen(str1) + 1) * sizeof(char)); // BAD [NOT DETECTED]
50+
buffer = (char *)malloc((strlen(str1) + 1) * sizeof(char)); // BAD
5151
strcpy(buffer, str1);
5252
strcat(buffer, str2);
5353
break;

cpp/ql/test/query-tests/Security/CWE/CWE-131/semmle/NoSpaceForZeroTerminator/NoSpaceForZeroTerminator.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
| test.c:16:20:16:25 | call to malloc | This allocation does not include space to null-terminate the string. |
44
| test.c:32:20:32:25 | call to malloc | This allocation does not include space to null-terminate the string. |
55
| test.c:49:20:49:25 | call to malloc | This allocation does not include space to null-terminate the string. |
6+
| test.c:64:20:64:25 | call to malloc | This allocation does not include space to null-terminate the string. |
67
| test.cpp:24:35:24:40 | call to malloc | This allocation does not include space to null-terminate the string. |
8+
| test.cpp:31:35:31:40 | call to malloc | This allocation does not include space to null-terminate the string. |
79
| test.cpp:45:28:45:33 | call to malloc | This allocation does not include space to null-terminate the string. |
810
| test.cpp:55:28:55:33 | call to malloc | This allocation does not include space to null-terminate the string. |
911
| test.cpp:63:28:63:33 | call to malloc | This allocation does not include space to null-terminate the string. |

cpp/ql/test/query-tests/Security/CWE/CWE-131/semmle/NoSpaceForZeroTerminator/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void good2(char *str) {
6060
}
6161

6262
void bad3(char *str) {
63-
// BAD -- Not allocating space for '\0' terminator [NOT DETECTED]
63+
// BAD -- Not allocating space for '\0' terminator
6464
char *buffer = malloc(strlen(str) * sizeof(char));
6565
strcpy(buffer, str);
6666
free(buffer);

cpp/ql/test/query-tests/Security/CWE/CWE-131/semmle/NoSpaceForZeroTerminator/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void bad1(wchar_t *wstr) {
2727
}
2828

2929
void bad2(wchar_t *wstr) {
30-
// BAD -- Not allocating space for '\0' terminator [NOT DETECTED]
30+
// BAD -- Not allocating space for '\0' terminator
3131
wchar_t *wbuffer = (wchar_t *)malloc(wcslen(wstr) * sizeof(wchar_t));
3232
wcscpy(wbuffer, wstr);
3333
free(wbuffer);

0 commit comments

Comments
 (0)