From c866abd84259acacf79524921a0ca6634fd71ddd Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Tue, 7 Feb 2017 19:15:18 +0100 Subject: [PATCH] test.c: Fix buffer overrun found by coverity --- test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.c b/test.c index 9277497..86fe448 100644 --- a/test.c +++ b/test.c @@ -114,7 +114,7 @@ static int print_preallocated(cJSON *root) } /* create buffer to fail */ - len_fail = strlen(out); + len_fail = strlen(out) + sizeof('\0'); buf_fail = (char*)malloc(len_fail); if (buf_fail == NULL) {