Skip to content

Commit

Permalink
ensure: Fix potential off by one error.
Browse files Browse the repository at this point in the history
  • Loading branch information
FSMaxB committed Mar 23, 2017
1 parent e58f7ec commit cc84a44
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 @@ -259,7 +259,7 @@ static unsigned char* ensure(printbuffer * const p, size_t needed, const interna
return NULL;
}

needed += p->offset;
needed += p->offset + 1;
if (needed <= p->length)
{
return p->buffer + p->offset;
Expand Down

0 comments on commit cc84a44

Please sign in to comment.