diff options
author | drh <> | 2023-07-28 20:59:25 +0000 |
---|---|---|
committer | drh <> | 2023-07-28 20:59:25 +0000 |
commit | 3e053c50b45279edc2b48ddae81eeaae53183982 (patch) | |
tree | 947b4a94ace1da1cbd3c6820ef963e766cd41260 /src/json.c | |
parent | 58b5921ca460032c6d19bfe6f0f736763f33c3bc (diff) | |
download | sqlite-3e053c50b45279edc2b48ddae81eeaae53183982.tar.gz sqlite-3e053c50b45279edc2b48ddae81eeaae53183982.zip |
Do not allow the same JSON parse to be input to both arguments to the
json_patch() routine.
FossilOrigin-Name: 8e781c6742792b3899ca60efc49c7eaee1df9f6b03d27c254b0e148b82946e19
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/json.c b/src/json.c index cc39264c0..2a002ba08 100644 --- a/src/json.c +++ b/src/json.c @@ -2672,10 +2672,11 @@ static void jsonPatchFunc( UNUSED_PARAMETER(argc); pX = jsonParseCached(ctx, argv[0], ctx, 1); if( pX==0 ) return; + assert( pX->hasMod==0 ); + pX->hasMod = 1; pY = jsonParseCached(ctx, argv[1], ctx, 1); if( pY==0 ) return; pX->useMod = 1; - pX->hasMod = 1; pY->useMod = 1; pResult = jsonMergePatch(pX, 0, pY->aNode); assert( pResult!=0 || pX->oom ); |