mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-11-18 19:41:01 +00:00
print_number: fix Off-By-One error
Thanks @liuyunbin for reporting this in #230
This commit is contained in:
1 parent
28d4410f42
commit
4d84acf926
1 file changed
+1
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user