Skip to content

Commit

Permalink
print_number: fix Off-By-One error
Browse files Browse the repository at this point in the history
Thanks @liuyunbin for reporting this in #230
  • Loading branch information
FSMaxB committed Jan 9, 2018
1 parent 28d4410 commit 4d84acf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4d84acf

Please sign in to comment.