mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
ensure: Fix potential off by one error.
This commit is contained in:
parent
e58f7ec027
commit
cc84a446be
2
cJSON.c
2
cJSON.c
@ -259,7 +259,7 @@ static unsigned char* ensure(printbuffer * const p, size_t needed, const interna
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
needed += p->offset;
|
needed += p->offset + 1;
|
||||||
if (needed <= p->length)
|
if (needed <= p->length)
|
||||||
{
|
{
|
||||||
return p->buffer + p->offset;
|
return p->buffer + p->offset;
|
||||||
|
Loading…
Reference in New Issue
Block a user