diff options
author | drh <> | 2023-12-04 19:14:13 +0000 |
---|---|---|
committer | drh <> | 2023-12-04 19:14:13 +0000 |
commit | 0b8b1c309d7264ecc6b24608be552d1d47e5b299 (patch) | |
tree | 50d52b4a0f255393f00beddba392d50e660597c8 /src/json.c | |
parent | 3fedb7e59e6a5208f006cad5e02be79abdd2e759 (diff) | |
download | sqlite-0b8b1c309d7264ecc6b24608be552d1d47e5b299.tar.gz sqlite-0b8b1c309d7264ecc6b24608be552d1d47e5b299.zip |
Do not make the input JSONB editable in json_remove() if there are no PATH
argument.
FossilOrigin-Name: 66594544f3ba9977475a3e3f74404eb2b2fb845053b28bd24c2b52c7df94e9d7
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/json.c b/src/json.c index aefd47498..97c65df0b 100644 --- a/src/json.c +++ b/src/json.c @@ -2802,7 +2802,6 @@ rebuild_from_cache: if( n==0 || sz+n!=p->nBlob || ((p->aBlob[0] & 0x0f)<=JSONB_FALSE && sz>0) - || sz+n!=p->nBlob ){ goto json_pfa_malformed; } @@ -3556,7 +3555,7 @@ static void jsonRemoveFunc( u32 rc; /* Subroutine return code */ if( argc<1 ) return; - p = jsonParseFuncArg(ctx, argv[0], JSON_EDITABLE); + p = jsonParseFuncArg(ctx, argv[0], argc>1 ? JSON_EDITABLE : 0); if( p==0 ) return; for(i=1; i<argc; i++){ zPath = (const char*)sqlite3_value_text(argv[i]); |