aboutsummaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
authordrh <>2023-10-05 16:33:00 +0000
committerdrh <>2023-10-05 16:33:00 +0000
commit0585d9f08f0b7786739621b3e41362079b2cb1e9 (patch)
treecf2000f8419a6cb7969a994021b9532e24703400 /src/json.c
parent01acfd5805349741a81b0c8666364f3795915753 (diff)
downloadsqlite-0585d9f08f0b7786739621b3e41362079b2cb1e9.tar.gz
sqlite-0585d9f08f0b7786739621b3e41362079b2cb1e9.zip
Slightly stricter testing for when a BLOB is valid JSONB: If the element
is a null, true, or false, its payload size must be zero. FossilOrigin-Name: 487781be8a93d9b8d870efb9f25822bb4bbcf9d39d571d1017e9c29043ea515d
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/json.c b/src/json.c
index 24487f430..c405c5943 100644
--- a/src/json.c
+++ b/src/json.c
@@ -3415,6 +3415,8 @@ static int jsonFuncArgMightBeBinary(sqlite3_value *pJson){
s.nBlob = nBlob;
n = jsonbPayloadSize(&s, 0, &sz);
if( n==0 ) return 0;
+ if( sz+n!=(u32)nBlob ) return 0;
+ if( (aBlob[0] & 0x0f)<=JSONB_FALSE && sz>0 ) return 0;
return sz+n==(u32)nBlob;
}