From c795e3df7aacc12f064a491ca1bc61923185e2df Mon Sep 17 00:00:00 2001 From: drh Date: Sun, 17 May 2020 13:47:28 +0000 Subject: Avoid harmless UB in memcpy() in the JSON extension. FossilOrigin-Name: 69e149f76853d196c8855fedfc98848b60fb116ac36bc08824b1a122469f8ece --- ext/misc/json1.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/misc/json1.c') diff --git a/ext/misc/json1.c b/ext/misc/json1.c index d42cad17a..caf7a99d6 100644 --- a/ext/misc/json1.c +++ b/ext/misc/json1.c @@ -254,6 +254,7 @@ static int jsonGrow(JsonString *p, u32 N){ /* Append N bytes from zIn onto the end of the JsonString string. */ static void jsonAppendRaw(JsonString *p, const char *zIn, u32 N){ + if( N==0 ) return; if( (N+p->nUsed >= p->nAlloc) && jsonGrow(p,N)!=0 ) return; memcpy(p->zBuf+p->nUsed, zIn, N); p->nUsed += N; -- cgit v1.2.3