cJSON

mirror of Dave's cJSON
git clone git://git.thc420.xyz/cJSON
Log | Files | Refs | README | LICENSE

commit 2683d4d9873df87c4bdccc523903ddd78d1ad250
parent 3c1bfe125cb5def3caf2fd0820b76fc2f39776d9
Author: Max Bruckner <max@maxbruckner.de>
Date:   Wed,  5 Apr 2017 16:35:55 +0200

ensure: Fix overflow detection

Diffstat:
McJSON.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cJSON.c b/cJSON.c @@ -276,7 +276,7 @@ static unsigned char* ensure(printbuffer * const p, size_t needed, const interna } /* calculate new buffer size */ - if (newsize > (INT_MAX / 2)) + if (needed > (INT_MAX / 2)) { /* overflow of int, use INT_MAX if possible */ if (needed <= INT_MAX)