diff --git a/cJSON.c b/cJSON.c index 283faa0..8c0e932 100644 --- a/cJSON.c +++ b/cJSON.c @@ -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;