1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

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
This commit is contained in:
drh
2023-10-05 16:33:00 +00:00
parent 01acfd5805
commit 0585d9f08f
3 changed files with 9 additions and 7 deletions

View File

@@ -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;
}