mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
CPP: Basic fix.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
| test.c:15:20:15:25 | call to malloc | This allocation does not include space to null-terminate the string. |
|
||||
| test.c:29:20:29:25 | call to malloc | This allocation does not include space to null-terminate the string. |
|
||||
| test.c:44:20:44:25 | call to malloc | This allocation does not include space to null-terminate the string. |
|
||||
| test.c:72:17:72:22 | call to malloc | This allocation does not include space to null-terminate the string. |
|
||||
| test.cpp:18:35:18:40 | call to malloc | This allocation does not include space to null-terminate the string. |
|
||||
|
||||
@@ -67,7 +67,7 @@ void good3(char *str) {
|
||||
void *memcpy(void *s1, const void *s2, size_t n);
|
||||
|
||||
void good4(char *str) {
|
||||
// GOOD -- allocating a non zero-terminated string [FALSE POSITIVE]
|
||||
// GOOD -- allocating a non zero-terminated string
|
||||
int len = strlen(str);
|
||||
char *buffer = malloc(len);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user