mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
test.c: Fix buffer overrun found by coverity
This commit is contained in:
parent
1f5538f79d
commit
c866abd842
2
test.c
2
test.c
@ -114,7 +114,7 @@ static int print_preallocated(cJSON *root)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* create buffer to fail */
|
/* create buffer to fail */
|
||||||
len_fail = strlen(out);
|
len_fail = strlen(out) + sizeof('\0');
|
||||||
buf_fail = (char*)malloc(len_fail);
|
buf_fail = (char*)malloc(len_fail);
|
||||||
if (buf_fail == NULL)
|
if (buf_fail == NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user