From c784f76c77a225b814817250009a87980b9f9e59 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Mon, 6 Mar 2017 10:48:15 +0100 Subject: [PATCH] cJSON_strdup: Use sizeof("") instead of 1 --- cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cJSON.c b/cJSON.c index 891cab3..975bcab 100644 --- a/cJSON.c +++ b/cJSON.c @@ -100,7 +100,7 @@ static unsigned char* cJSON_strdup(const unsigned char* str, const internal_hook return NULL; } - len = strlen((const char*)str) + 1; + len = strlen((const char*)str) + sizeof(""); if (!(copy = (unsigned char*)hooks->allocate(len))) { return NULL;