Fix a buffer over-read that could occur as part of an fts5 secure-delete operation on a database containing corrupt fts5 records.
FossilOrigin-Name: a35c50eca907d0cf373b7962c359aebfce8ac7c34ce81edeb99122d4fb5804f7
This commit is contained in:
parent
26d71f03fc
commit
d679f9e5d1
@ -4840,7 +4840,9 @@ static void fts5DoSecureDelete(
|
||||
iOff += sqlite3Fts5PutVarint(&aPg[iOff], nPrefix);
|
||||
}
|
||||
iOff += sqlite3Fts5PutVarint(&aPg[iOff], nSuffix);
|
||||
if( nPrefix2>nPrefix ){
|
||||
if( nPrefix2>pSeg->term.n ){
|
||||
p->rc = FTS5_CORRUPT;
|
||||
}else if( nPrefix2>nPrefix ){
|
||||
memcpy(&aPg[iOff], &pSeg->term.p[nPrefix], nPrefix2-nPrefix);
|
||||
iOff += (nPrefix2-nPrefix);
|
||||
}
|
||||
|
@ -96,4 +96,33 @@ set r 137438953475
|
||||
db close
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 2.0 {
|
||||
CREATE VIRTUAL TABLE t1 USING fts5(x);
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES('abc');
|
||||
INSERT INTO t1 VALUES('b d d d');
|
||||
COMMIT;
|
||||
INSERT INTO t1(t1, rank) VALUES('secure-delete', 1);
|
||||
}
|
||||
|
||||
execsql_pp {
|
||||
SELECT id, quote(block) FROM t1_data
|
||||
}
|
||||
|
||||
do_execsql_test 2.1 {
|
||||
SELECT quote(block) FROM t1_data WHERE id > 10;
|
||||
} {X'0000001A04306162630102020101620202020101640206030303040806'}
|
||||
|
||||
do_execsql_test 2.2 {
|
||||
UPDATE t1_data SET
|
||||
block=X'0000001A04306162630102025501620202020101640206030303040806'
|
||||
WHERE id>10
|
||||
}
|
||||
|
||||
do_catchsql_test 2.3 {
|
||||
DELETE FROM t1 WHERE rowid = 1
|
||||
} {1 {database disk image is malformed}}
|
||||
|
||||
finish_test
|
||||
|
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Make\ssure\stemporary\ssqlite3_value\sobjects\sused\sby\sSTAT4\sare\sreset\sto\sNULL\sprior\nto\sbeing\sreused,\sto\sprevent\sa\smemory\sleak\sassociated\swith\nthe\scustom\sxDel\sstring\svalue\sdestructor.\ndbsqlfuzz\s65209ab5d5730e4fd14fff9d024325a77239036e.
|
||||
D 2023-06-11T21:58:20.965
|
||||
C Fix\sa\sbuffer\sover-read\sthat\scould\soccur\sas\spart\sof\san\sfts5\ssecure-delete\soperation\son\sa\sdatabase\scontaining\scorrupt\sfts5\srecords.
|
||||
D 2023-06-12T11:06:57.895
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@ -92,7 +92,7 @@ F ext/fts5/fts5_buffer.c 3001fbabb585d6de52947b44b455235072b741038391f830d6b7292
|
||||
F ext/fts5/fts5_config.c 051056a9052f5d3a4d1c695f996fd364f920e341f136c60ab2c04aa7e267113f
|
||||
F ext/fts5/fts5_expr.c 58fb8ceddfb1cefcd54510f9f2f33c220ef9d1b3fa77462111f5ae2a825ab7b1
|
||||
F ext/fts5/fts5_hash.c d4fb70940359f2120ccd1de7ffe64cc3efe65de9e8995b822cd536ff64c96982
|
||||
F ext/fts5/fts5_index.c b7c9d81b123f4fd6e21c6435540a6fa9fbb9d519ae2125d0eb251169bf2a8c14
|
||||
F ext/fts5/fts5_index.c fe98ebd8835760b9c787d20f6b50d648a761afd8e3b55780e718ee34c694743b
|
||||
F ext/fts5/fts5_main.c b4dba04a36aaf9b8e8cef0100b6dbb422cc74753eacc11d6401cac7a87c0f38d
|
||||
F ext/fts5/fts5_storage.c 76c6085239eb44424004c022e9da17a5ecd5aaec859fba90ad47d3b08f4c8082
|
||||
F ext/fts5/fts5_tcl.c b1445cbe69908c411df8084a10b2485500ac70a9c747cdc8cda175a3da59d8ae
|
||||
@ -138,7 +138,7 @@ F ext/fts5/test/fts5corrupt3.test 7da9895dafa404efd20728f66ff4b94399788bdc042c36
|
||||
F ext/fts5/test/fts5corrupt4.test f4c08e2182a48d8b70975fd869ee5391855c06d8a0ff87b6a2529e7c5a88a1d3
|
||||
F ext/fts5/test/fts5corrupt5.test eb6ba5ca28ef7c4c6b01e850d388cdb3dacc8c4c2f383f79d0a98128257742b4
|
||||
F ext/fts5/test/fts5corrupt6.test bf8eeae07825b088b9665d9d8e4accbd8dc9bf3cb85b6c64cf6c9e18ccc420a4
|
||||
F ext/fts5/test/fts5corrupt7.test f3e68673af2514e31dd67a2ed163f7f597252ab683dec155b8db0cdc0b668342
|
||||
F ext/fts5/test/fts5corrupt7.test 80ad7f683a8bda2404731bb77e8c3dbbb620c1f6cc583cca8239f6accd6338c0
|
||||
F ext/fts5/test/fts5delete.test 619295b20dbc1d840b403ee07c878f52378849c3c02e44f2ee143b3e978a0aa7
|
||||
F ext/fts5/test/fts5detail.test 54015e9c43ec4ba542cfb93268abdf280e0300f350efd08ee411284b03595cc4
|
||||
F ext/fts5/test/fts5determin.test 1b77879b2ae818b5b71c859e534ee334dac088b7cf3ff3bf76a2c82b1c788d11
|
||||
@ -2040,8 +2040,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 70e12efd1b189560e07f59db03a20b8c1ab19224aae4fc3d7c0bdfd2568064ea
|
||||
R 17ce6759cf4b3b8032e0247b78c0a077
|
||||
U drh
|
||||
Z 97dad2d6a167510bb1574da3d7628541
|
||||
P 88be7075cdc7000d3a1e84e49064cf8c28fc7caca9c464f44a83265223961b51
|
||||
R 49cb1f3ddd7334fea5dd72c4c901171e
|
||||
U dan
|
||||
Z b6a4715238fd096955f6c42c541f8f89
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
@ -1 +1 @@
|
||||
88be7075cdc7000d3a1e84e49064cf8c28fc7caca9c464f44a83265223961b51
|
||||
a35c50eca907d0cf373b7962c359aebfce8ac7c34ce81edeb99122d4fb5804f7
|
Loading…
Reference in New Issue
Block a user