aboutsummaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
authordrh <>2023-10-07 19:46:22 +0000
committerdrh <>2023-10-07 19:46:22 +0000
commitde8ccf00fbe12a0c4f353224e94412ef0be13090 (patch)
treefb3dab8bfcdef247f427a6fe2c5e8a9e515f5d89 /src/json.c
parent3efb2c47918e47c391d04b49cbebe24b31c3464b (diff)
downloadsqlite-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.c2
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;