diff --git a/cJSON.c b/cJSON.c index 9b6ef33b847b1ad2e146e4725a8fd7057eb098f7..4cfc71951be53a2a1187d67d5b8c12cd6f5d2101 100644 --- a/cJSON.c +++ b/cJSON.c @@ -512,7 +512,7 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out } /* reserve appropriate space in the output */ - output_pointer = ensure(output_buffer, (size_t)length); + output_pointer = ensure(output_buffer, (size_t)length + sizeof("")); if (output_pointer == NULL) { return false;