Fix a potential use of uninitialized value in json_valid() with 2nd

argument of 8.

FossilOrigin-Name: fa102036fe46eeb71b7df3e265be1935ae5c78e0b939b08841bcfb8abadbc77a
This commit is contained in:
drh 2023-12-11 02:39:11 +00:00
parent bfa0de86e6
commit b89e64d822
3 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,5 @@
C Fix\sa\sharmless\sUBSAN\swarning.
D 2023-12-08T16:56:50.764
C Fix\sa\spotential\suse\sof\suninitialized\svalue\sin\sjson_valid()\swith\s2nd\nargument\sof\s8.
D 2023-12-11T02:39:11.053
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -696,7 +696,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 5631fd482c13680f142cc9f3403022232584978fa9d0e86ac282c310bc3d8902
F src/json.c 022548736478f10bec4f2766f2c9fe1cc25c06b14cabb0ca64b4a1beb83fbf16
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36
F src/main.c 1b89f3de98d1b59fec5bac1d66d6ece21f703821b8eaa0d53d9604c35309f6f9
@ -2153,8 +2153,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 d2f2174ce2cc89606034e158149a2d05fc3627ec4d5cdb772add7a2250f29d78
R 4e2efed7bb86322a932c64421cda8002
P 1503cba6d17e9bade7a5c103ddd23241ff4741f9a2e3032ffe2987af243dae65
R 10c5202c73d5a29cc977b618b1930c91
U drh
Z d8061dc139c0b2205f580742f9475aee
Z 03628577bea44fb563932e72818a5e19
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
1503cba6d17e9bade7a5c103ddd23241ff4741f9a2e3032ffe2987af243dae65
fa102036fe46eeb71b7df3e265be1935ae5c78e0b939b08841bcfb8abadbc77a

View File

@ -3972,6 +3972,7 @@ static void jsonValidFunc(
if( sx.eErr & JSTRING_OOM ) oom = 1;
if( sx.eErr==0 ){
memset(&px, 0, sizeof(px));
jsonStringTerminate(&sx);
px.zJson = sx.zBuf;
px.nJson = sx.nUsed;
if( jsonXlateTextToBlob(&px, 0)==px.nJson ){