diff options
author | drh <> | 2023-10-07 19:46:22 +0000 |
---|---|---|
committer | drh <> | 2023-10-07 19:46:22 +0000 |
commit | de8ccf00fbe12a0c4f353224e94412ef0be13090 (patch) | |
tree | fb3dab8bfcdef247f427a6fe2c5e8a9e515f5d89 /src/json.c | |
parent | 3efb2c47918e47c391d04b49cbebe24b31c3464b (diff) | |
download | sqlite-de8ccf00fbe12a0c4f353224e94412ef0be13090.tar.gz sqlite-de8ccf00fbe12a0c4f353224e94412ef0be13090.zip |
The return from sqlite3_value_blob() in jsonFuncArgMightBeBinary() might
be a NULL pointer. Check for that case.
FossilOrigin-Name: 7b52b266b066f1385144c1103a3a411306db5f44568366ae1e93cd8cce799bbc
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/json.c b/src/json.c index 1cfaaaf58..f2cb79688 100644 --- a/src/json.c +++ b/src/json.c @@ -3451,7 +3451,7 @@ static int jsonFuncArgMightBeBinary(sqlite3_value *pJson){ nBlob = sqlite3_value_bytes(pJson); if( nBlob<1 ) return 0; aBlob = sqlite3_value_blob(pJson); - if( (aBlob[0] & 0x0f)>JSONB_OBJECT ) return 0; + if( aBlob==0 || (aBlob[0] & 0x0f)>JSONB_OBJECT ) return 0; memset(&s, 0, sizeof(s)); s.aBlob = (u8*)aBlob; s.nBlob = nBlob; |