From beb3fb690469c90bb77b00b041ff474cc6e76cf2 Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 26 Jul 2023 19:11:47 +0000 Subject: [PATCH] Make sure jsonReplaceNode() always leaves the JsonParse in a consistent state even if an error is encountered. FossilOrigin-Name: 01d52232dd6fbd253e77419a17df3df83d49434792d288ef96e14739a89cef3b --- manifest | 15 +++++++-------- manifest.uuid | 2 +- src/json.c | 1 + 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 96c91cdd84..5c7bcfa676 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\s".scanstats\svm"\scommand\sto\sthe\sshell\stool.\sFor\sprofiling\sVM\scode\sin\sSQLITE_ENABLE_STMT_SCANSTATUS\sbuilds. -D 2023-07-26T17:51:05.557 +C Make\ssure\sjsonReplaceNode()\salways\sleaves\sthe\sJsonParse\sin\sa\sconsistent\sstate\seven\sif\san\serror\sis\sencountered. +D 2023-07-26T19:11:47.116 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -598,7 +598,7 @@ F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51 F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6 F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71 F src/insert.c 3f0a94082d978bbdd33c38fefea15346c6c6bffb70bc645a71dc0f1f87dd3276 -F src/json.c 512bc389b42c68b34571ca532afb0f4bb235b1fc11ea5c9a4f6850c64fa12ab4 +F src/json.c 00ee51e8365de51d76473900c181edb3265cde636badc779068bbb425e401211 F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa F src/loadext.c 176d6b2cb18a6ad73b133db17f6fc351c4d9a2d510deebdb76c22bde9cfd1465 F src/main.c 512b1d45bc556edf4471a845afb7ba79e64bd5b832ab222dc195c469534cd002 @@ -2044,9 +2044,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P df099ad713011b67b09cb1e5f0fa2e6b45f9cee0ce9d3c118c5dbca3563d20a5 7df08fd35e9d4bc471aa9fbc4c81d2ebcfd2be6c4c38143342b3d9d727c9df22 -R 41e3bcc8b2de77a8519996fee810e7fd -T +closed 7df08fd35e9d4bc471aa9fbc4c81d2ebcfd2be6c4c38143342b3d9d727c9df22 -U dan -Z 4c8141df90dc53dee045e3726a5dbff7 +P 0cbec3990d4101142bfb831f8e6527b73baabebbd30fa7f59275b217dbce6a8d +R f441bd92e9087b2cb305790bb3fcf419 +U drh +Z 5cac453cc99ba9487a886bdc07348b7a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index a215484c0d..4831e7a0a7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0cbec3990d4101142bfb831f8e6527b73baabebbd30fa7f59275b217dbce6a8d \ No newline at end of file +01d52232dd6fbd253e77419a17df3df83d49434792d288ef96e14739a89cef3b \ No newline at end of file diff --git a/src/json.c b/src/json.c index 9eb2302684..7fb72aecb3 100644 --- a/src/json.c +++ b/src/json.c @@ -2853,6 +2853,7 @@ static void jsonReplaceNode( break; } case SQLITE_BLOB: { + jsonParseAddNode(p, JSON_NULL, 0, 0); sqlite3_result_error(pCtx, "JSON cannot hold BLOB values", -1); p->nErr++; break;