diff options
author | drh <> | 2023-12-08 14:54:22 +0000 |
---|---|---|
committer | drh <> | 2023-12-08 14:54:22 +0000 |
commit | 2a27be21078dfcd5e53827eee648d2fdfd3be330 (patch) | |
tree | 20b2bc5d46c688d8a5dac03c0e0ab5c7998c9e8f /src | |
parent | 9d2446dc13ff564d7938ed8fb4d454660378f830 (diff) | |
download | sqlite-2a27be21078dfcd5e53827eee648d2fdfd3be330.tar.gz sqlite-2a27be21078dfcd5e53827eee648d2fdfd3be330.zip |
Fix a potential problem RCStr access on a JsonString object that is not
really and RCStr. Fuzzer/UBSAN find.
FossilOrigin-Name: d2f2174ce2cc89606034e158149a2d05fc3627ec4d5cdb772add7a2250f29d78
Diffstat (limited to 'src')
-rw-r--r-- | src/json.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/json.c b/src/json.c index 6a4a0babf..506080174 100644 --- a/src/json.c +++ b/src/json.c @@ -4115,7 +4115,7 @@ static void jsonArrayCompute(sqlite3_context *ctx, int isFinal){ }else if( flags & JSON_BLOB ){ jsonReturnStringAsBlob(pStr); if( isFinal ){ - sqlite3RCStrUnref(pStr->zBuf); + if( !pStr->bStatic ) sqlite3RCStrUnref(pStr->zBuf); }else{ pStr->nUsed--; } @@ -4235,7 +4235,7 @@ static void jsonObjectCompute(sqlite3_context *ctx, int isFinal){ }else if( flags & JSON_BLOB ){ jsonReturnStringAsBlob(pStr); if( isFinal ){ - sqlite3RCStrUnref(pStr->zBuf); + if( !pStr->bStatic ) sqlite3RCStrUnref(pStr->zBuf); }else{ pStr->nUsed--; } |