From: drh <> Date: Fri, 30 Apr 2021 16:12:40 +0000 (+0000) Subject: Guard against a NULL-pointer dereference following OOM in the JSON extension. X-Git-Tag: version-3.36.0~126 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=76baad95f4793ac2b9793e8f820c8c371f3b8fa0;p=thirdparty%2Fsqlite.git Guard against a NULL-pointer dereference following OOM in the JSON extension. FossilOrigin-Name: ea221f3c8e243a5dc4952e510cbe396614a24876bacdc04fb1ebd4127c7ef0d9 --- diff --git a/ext/misc/json1.c b/ext/misc/json1.c index 76c6e40f83..41ff01db49 100644 --- a/ext/misc/json1.c +++ b/ext/misc/json1.c @@ -299,7 +299,7 @@ static void jsonAppendSeparator(JsonString *p){ */ static void jsonAppendString(JsonString *p, const char *zIn, u32 N){ u32 i; - if( (N+p->nUsed+2 >= p->nAlloc) && jsonGrow(p,N+2)!=0 ) return; + if( zIn==0 || ((N+p->nUsed+2 >= p->nAlloc) && jsonGrow(p,N+2)!=0) ) return; p->zBuf[p->nUsed++] = '"'; for(i=0; i