Protect a memcpy() against OOM conditions.
FossilOrigin-Name: 26144d1c25ae0435db568009ba05e485d23d146f2b1f29f3a426c87860316aed
This commit is contained in:
parent
2c26bde4ff
commit
05db513435
12
manifest
12
manifest
@ -1,5 +1,5 @@
|
|||||||
C Do\snot\sallow\sa\sJsonParse\sobject\sto\sbe\sconsidered\s"editable"\safter\san\sOOM.
|
C Protect\sa\smemcpy()\sagainst\sOOM\sconditions.
|
||||||
D 2023-12-02T15:59:48.114
|
D 2023-12-02T16:11:22.802
|
||||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||||
@ -688,7 +688,7 @@ F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51
|
|||||||
F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6
|
F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6
|
||||||
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
|
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
|
||||||
F src/insert.c 3f0a94082d978bbdd33c38fefea15346c6c6bffb70bc645a71dc0f1f87dd3276
|
F src/insert.c 3f0a94082d978bbdd33c38fefea15346c6c6bffb70bc645a71dc0f1f87dd3276
|
||||||
F src/json.c 837599bcccc7b1533273d17697b33acb747f6a742e0789a716a1d991e83b76ea
|
F src/json.c 21ffece5a6e846480e6f108203d5ee3838261c0d8af773986895b1fd33fea593
|
||||||
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
|
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
|
||||||
F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36
|
F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36
|
||||||
F src/main.c 1b89f3de98d1b59fec5bac1d66d6ece21f703821b8eaa0d53d9604c35309f6f9
|
F src/main.c 1b89f3de98d1b59fec5bac1d66d6ece21f703821b8eaa0d53d9604c35309f6f9
|
||||||
@ -2145,8 +2145,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
|||||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||||
P d2fba2cbdc3870d34228c1a9446eced884325acc183900d7dd0b96132570fb4a
|
P c6bacf57bd6fe0fee00c9d41163a270b60997c20659949971bbf5c6c62622bfe
|
||||||
R 4ccb83954df0ebdab5ce51302095cafb
|
R 0ee4315c57b01c35ef946afcac5153f9
|
||||||
U drh
|
U drh
|
||||||
Z 5295c6ae0590ca2382d336c94f2f32b0
|
Z 15254a8c6732e3004ca75d702e3d0bea
|
||||||
# Remove this line to create a well-formed Fossil manifest.
|
# Remove this line to create a well-formed Fossil manifest.
|
||||||
|
@ -1 +1 @@
|
|||||||
c6bacf57bd6fe0fee00c9d41163a270b60997c20659949971bbf5c6c62622bfe
|
26144d1c25ae0435db568009ba05e485d23d146f2b1f29f3a426c87860316aed
|
14
src/json.c
14
src/json.c
@ -2239,12 +2239,14 @@ static u32 jsonLookupBlobStep(
|
|||||||
if( jsonBlobMakeEditable(pParse, ix.nBlob+nKey+v.nBlob) ){
|
if( jsonBlobMakeEditable(pParse, ix.nBlob+nKey+v.nBlob) ){
|
||||||
nIns = ix.nBlob + nKey + v.nBlob;
|
nIns = ix.nBlob + nKey + v.nBlob;
|
||||||
jsonBlobEdit(pParse, j, 0, 0, nIns);
|
jsonBlobEdit(pParse, j, 0, 0, nIns);
|
||||||
memcpy(&pParse->aBlob[j], ix.aBlob, ix.nBlob);
|
if( !pParse->oom ){
|
||||||
k = j + ix.nBlob;
|
memcpy(&pParse->aBlob[j], ix.aBlob, ix.nBlob);
|
||||||
memcpy(&pParse->aBlob[k], zKey, nKey);
|
k = j + ix.nBlob;
|
||||||
k += nKey;
|
memcpy(&pParse->aBlob[k], zKey, nKey);
|
||||||
memcpy(&pParse->aBlob[k], v.aBlob, v.nBlob);
|
k += nKey;
|
||||||
if( pParse->delta ) jsonAfterEditSizeAdjust(pParse, iRoot);
|
memcpy(&pParse->aBlob[k], v.aBlob, v.nBlob);
|
||||||
|
if( pParse->delta ) jsonAfterEditSizeAdjust(pParse, iRoot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
jsonParseReset(&v);
|
jsonParseReset(&v);
|
||||||
jsonParseReset(&ix);
|
jsonParseReset(&ix);
|
||||||
|
Loading…
Reference in New Issue
Block a user