diff options
author | drh <drh@noemail.net> | 2020-05-17 13:47:28 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2020-05-17 13:47:28 +0000 |
commit | c795e3df7aacc12f064a491ca1bc61923185e2df (patch) | |
tree | 3f6b91b618715ac724b67731c49071b9e2684c25 /ext/misc/json1.c | |
parent | d924e7bc78a4ca604bce0f8d9d0390d3feddba01 (diff) | |
download | sqlite-c795e3df7aacc12f064a491ca1bc61923185e2df.tar.gz sqlite-c795e3df7aacc12f064a491ca1bc61923185e2df.zip |
Avoid harmless UB in memcpy() in the JSON extension.
FossilOrigin-Name: 69e149f76853d196c8855fedfc98848b60fb116ac36bc08824b1a122469f8ece
Diffstat (limited to 'ext/misc/json1.c')
-rw-r--r-- | ext/misc/json1.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; |