1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-10-23 21:49:02 +03:00
Commit Graph

5866 Commits

Author SHA1 Message Date
drh
ee5d76c56d Update some test cases in fts5corrupt3.test and fts5corruptB.test to account for recent updates to database and record corruption detection.
FossilOrigin-Name: a508bb8f88e79742df314e51e6404c964547f811d9361233157cd7a748ddfadb
2026-07-14 14:30:36 +00:00
drh
6b5272d8a7 Ensure that the "leaf-size" field of an fts5 record is only read from records that are actually leaves and are large enough to contain it.
FossilOrigin-Name: 7bad71288c6547964c36215938c1d16dd38d973ef8586f1a33814e83ee5a28f5
2026-07-09 21:10:01 +00:00
drh
c0c8251568 Fix an OOB read caused by passing an out-of-range phrase number to fts5 auxiliary API xPhraseFirstColumn() in detail=columns mode.
FossilOrigin-Name: 9aac477d65a948b3f32922899b7efbdba72faa48ac9a53cb356feafecffa9c8d
2026-07-06 16:55:39 +00:00
drh
2cf7691506 Fix another buffer overread in RBU that could occur when processing an RBU database with corrupt rbu_control fields.
FossilOrigin-Name: dd482ecec3256349799fd0c8515c133539552845aef7134a82388c748bec59b0
2026-07-06 16:52:58 +00:00
drh
3e02bd230c Fix mulutiple problems in RBU and reduce divergence between the Fossil
native implementation of delta and the variant of that code used by RBU.

FossilOrigin-Name: 6870e39ecc3425db7b80432ca4cf5b9f75615f58140192557d18ed6f432f46cd
2026-07-06 16:46:25 +00:00
drh
a3542dccaa Avoid a (harmless) 1-byte OOB read due to malformed inputs in the
normalize.c extension.

FossilOrigin-Name: a6cdeee6e63e3635373d7ecfdefb99b2d607290b4e419dcd37e7eed3e73a5a2c
2026-07-06 13:57:07 +00:00
drh
88c6a2e7bc Return an error if a patchset is passed to sqlite3rebaser_configure().
And avoid a buffer overread in the session module when an UPDATE change
is rebased against a baseline that records fewer columns than the UPDATE.

FossilOrigin-Name: 37c90c8fc2d694dabc7c8e7fd49ae2ab46f91f9b88fd7c829b72225881598495
2026-07-06 13:41:48 +00:00
drh
bd57e2ebb2 Properly handle errors from the readlink() system call in the
fileio.c extension.

FossilOrigin-Name: b6500b6bf167fdbef1e25322c15d8cf54ff11bc47b869af3ed4a8fc8e45e9e5c
2026-07-05 19:24:50 +00:00
drh
fe580a88ec Fix the parse_create_index() SQL function created by the incremental
integrity_check extension so that it works for widely correct CREATE INDEX
statements.
Also fix the extension so that it removes the parse_create_index() function.
Add the sqlite3_intck_register() API function so that the
parse_create_index() function can be more easily tested.

FossilOrigin-Name: 88bfcc736144c8b2c8c2c1797a091f03d95da5dcce8a17112c3d724dc1d02813
2026-07-05 19:18:45 +00:00
drh
ade5e04510 Fix possible one-byte OOB read in the fossildelta.c extension.
FossilOrigin-Name: 3d6c32fc0797d97196cc16f66aa00890b5c03e241a5632a0ab27cc46c33a19a3
2026-07-04 09:28:12 +00:00
drh
78d1f78ccd Improved data validation in fts5SecureDeleteOverflow().
FossilOrigin-Name: c87fc653b0bafb23063d38c9fcd059eaeedadcb7bb920a6121665850879146c5
2026-07-03 22:59:25 +00:00
drh
dcff2fa3f7 Avoid an integer overflow in the string allocator for the snippet()
function of FTS3/4, when SQLITE_MAX_LENGTH is unusually large.

FossilOrigin-Name: 38bb8275005c3d293d1b9174450a6bb8ce2ddbca1f5d1d5e457b999f0a002d4c
2026-07-03 19:19:01 +00:00
drh
258595adb3 Check for oversized iTermOff in fs5SegIterNextInit() and trigger a
corruption error if detected.

FossilOrigin-Name: 833d058ee396a9578316b4ef2e13214cbd265999a78d7f08b5c7e515abb32881
2026-06-28 00:24:37 +00:00
drh
450db5fbb4 Do not allow an integer overflow to bypass a leaf-term bound check
in the integrity-check function of FTS5.

FossilOrigin-Name: f45d03b1c52ae102eb92b4de21d6a5265831cfd47e51e3193b38d60744c2e0cf
2026-06-27 23:09:49 +00:00
drh
1d6e8d6c2f Make sure local functions in the series.c extension have only file scope.
FossilOrigin-Name: 713f3cf69a5e49e17785a020af7448f2882059ad41468fd45d981c90e0be1db2
2026-06-27 21:57:19 +00:00
drh
00f5dc622a In the amatch.c and fuzzer.c extensions (both of which are experimental,
for testing purposes only, and are not part of any deliverable) treat
NULL inputs as empty strings.  Limit input lengths in amatch.c

FossilOrigin-Name: 3c8ba6dca0dcb64c21212685ca4234090e0c73fac3bdebc3f159ff03d0d93f3c
2026-06-27 20:35:10 +00:00
drh
e151b6e4a1 Fix both a buffer overread and overwrite in the sessions rebase module.
FossilOrigin-Name: 12d0d2363a3082f68153393ed1aa91264ee987bc9187e7afd131d503f66e4faa
2026-06-26 15:17:08 +00:00
drh
a9fc90f932 Fix parsing of unterminated "[" tokens in the incremental integrity
check extension.

FossilOrigin-Name: 6a55dc85b73ef98f0ef31d7b0740bfe46ebb25653f2dff4eb34074d1b455925a
2026-06-26 14:47:07 +00:00
drh
948ff608ca Avoid 32-bit integer overflow in the zipfile extension given
ridiculous arguments.

FossilOrigin-Name: 2e1fdfbcc91da03795d6bb27980a329dc710d5c4c8540aa6e77413e29210be0e
2026-06-26 14:22:53 +00:00
drh
a7751a871b Fix a buffer overread that could occur in fts5 within a memcmp() when doing an integrity-check on corrupted records.
FossilOrigin-Name: f73adcfc87803f373b7c55ec280e3bcae4b9f3a1f3edc2ee21bf12c696a46be4
2026-06-26 14:11:19 +00:00
drh
7317e00f90 Fix parsing of quoted instantiation arguments in the spellfix extension.
FossilOrigin-Name: c4af6acfb0d04b418ad089ee619317a631a2dff5c7d45a88f704dbcb006f98d8
2026-06-26 13:55:52 +00:00
drh
842e4e5f20 Fix unbounded whitespace skip in the decimal extension.
FossilOrigin-Name: 9a1729a4840e8640770d557657742355f2723f2dda05efeaaf6641af730c34b8
2026-06-26 13:52:02 +00:00
drh
0c7f44361f Extra margin to prevent queue overflow in the RTree extension.
FossilOrigin-Name: 27f80408b8a499f50959e21fb1c039c6e430257ac7ceb11f5c3600b120b64258
2026-06-26 13:36:18 +00:00
drh
549b467f48 Fix the (non-deliverable, testing-use-only) closure extension so that it
parses quoted instantiation arguments correctly.

FossilOrigin-Name: edfe25b68a37bde4ae535285a11b24f721fbd76d9af8ee264d62c170f45bf52c
2026-06-26 13:07:11 +00:00
drh
081c9ebeb4 Fix the size of an allocation in fts3 to take into account that when merging a phrase doclist, each entry may grow by up to 1 byte if the rhs position of the merged lists is stored.
FossilOrigin-Name: bbaad09b3d090ba24c2069424d94897ebdef7c5fed13db9383d9cb363e3aa91a
2026-06-26 12:59:28 +00:00
drh
36d1b6d6ab Fix compiler warnings.
FossilOrigin-Name: 512d9449451c883a68a543f5ab8372b31324baf6216de7f71f7fc7589f2e1aab
2026-06-26 02:03:54 +00:00
dan
b9e0f62c3a Merge the fixes for the use-after-free problem caused by executing an ATTACH when a backup operation was active, and for the OOB read in the unused spellfix1 extension.
FossilOrigin-Name: 121a749d0f3d54eef7f35d527f0eed9a2531ac741452ed85d4c49556df8955ea
2026-06-23 20:28:51 +00:00
drh
a43ebd6ecf Fix a NULL pointer dereference that could occur in the unionvtab virtual table if the configuration SQL returned an SQL NULL value in place of a table name.
FossilOrigin-Name: 7e8de3ba28224a293fd1c220c3bf7ac5f721a01125debc5dce39f16745c43c17
2026-06-23 13:26:15 +00:00
drh
703395c39e Fix a NULL pointer dereference that can occur when misusing a extension
virtual table that was created for testing purposes.

FossilOrigin-Name: ee4f5d82a3347863f2eb544c780d3efcc00bb43d7ea2495aaf21099f73cf800f
2026-06-23 11:16:22 +00:00
drh
4f53fb28cd Fixes for three separate AI-discovered bugs in non-deliverable extensions.
FossilOrigin-Name: c980094956a348423469015952455a97df3ca08709338aa03ea8bbb418e8af24
2026-06-23 10:56:26 +00:00
stephan
06ca05fdfd Fixes for kvvfs journaling. Bug reports [bugs:20e208fe172cae4f|2026-06-20T08:49:41Z] and [bugs:76acc88b573e3a16|2026-06-20T18:35:54Z].
FossilOrigin-Name: 4c773f5d64246c7c47a569218215787ba2104bc2966c4bbd8907b936e396f6ea
2026-06-22 10:38:03 +00:00
drh
d5b7e82ccd Fix a cast in fts3_write so that it is applied as intended.
FossilOrigin-Name: 6c22c34e9a7bc7bb68680de87a73667f21d14bf201990040423afc426c23a4af
2026-06-19 12:14:55 +00:00
drh
b2de7df934 Fix an fts5 problem causing attempts to create locale=1 tables with more than 115 columns to fail.
FossilOrigin-Name: 4d993e8f5ffe4d34d4b1c579f9d50b60be6a3c6738e1c06d298e43b1222f7a66
2026-06-19 11:18:51 +00:00
drh
2161a3d88b Improvements to handling of inequality constraints on generate_series().value
against very large floating-point values.

FossilOrigin-Name: e10ff7cd09e962c207f897c38b83a813a3214fd4ac11e6a71ac577f21ba09fba
2026-06-15 16:27:51 +00:00
drh
051745a6c3 Avoid a possible buffer overrun in 32-bit builds of fts5 that could occur when processing corrupt records.
FossilOrigin-Name: 3a4667ce36a1548fffff8bbf946d84d6bbd21e7abb216d1f37717de74ce7e2a7
2026-06-15 13:53:44 +00:00
drh
633e08da82 Fix a problem that could cause fts5 to return incorrect answers when performing prefix queries on tokens with synonyms.
FossilOrigin-Name: 4f21004f9b5fc9766183a3c4ac44cfeb6cd3e5583fef9176a26fecc2910f8c08
2026-06-15 11:52:31 +00:00
drh
461f6c14c5 Fix rounding behavior in the decimal extension when all leading digits
are 9 and there is not fractional component.

FossilOrigin-Name: ae568e059bb179343c31baa3c8bcbe1c64fdcbb28b466af4840963c63d6369f5
2026-06-15 10:16:23 +00:00
drh
790e97cb4f Fix a buffer overwrite in fts3 that could occur while processing NEAR queries against corrupt records.
FossilOrigin-Name: 85afd8e291d280ff2124d1650720dd9934271de6efbd5a50eeaf1b621d3d0a6e
2026-06-12 16:04:50 +00:00
drh
2dc1c576e9 Fix a signed integer overflow that could occur in fts3 when processing corrupt database records.
FossilOrigin-Name: 42fe4d2e8bbb2ff9ebfd8a9b981bd8769f5273bba74cc1795396820f44a443cb
2026-06-12 11:45:37 +00:00
drh
a89c9f34d8 Fix a signed-integer overflow in fts5 that might occur when dealing with strategicly corrupted records.
FossilOrigin-Name: a36fc58e55c100f0c26e4426100c15287dc5613e06d5d1fb43845e3c7cda09df
2026-06-11 23:28:49 +00:00
drh
84865cd22a Fix a possible signed integer overflow in the RBU extension given a
maliciously crafted delta.

FossilOrigin-Name: c40f3e8e789792615b079ea1ca7968d462a12e0cb4405bd74f407c9a4b5c6188
2026-06-11 23:26:01 +00:00
drh
801d847cd9 Harden code that processes Fossil Deltas against OOM and maliciously
malformed delta blobs.

FossilOrigin-Name: 1657b9716f043e1af426bbd4ed50073b76c7c1b2f147b124b0b32e824bb83eb3
2026-06-11 23:22:57 +00:00
drh
3b161d32a0 Improved detection of corrupt node IDs in RTree shadow tables.
FossilOrigin-Name: 4e875ae5c3f0cb28fd40be9f1327d7496f95a55785cad68cb37472e4d1c2e6fd
2026-06-11 01:37:00 +00:00
drh
78a50f9e74 Fix four obscure yet separate problems in FTS5.
FossilOrigin-Name: a6eb055c35f091a8e864c1de3387d389e2bd3025c32596c0b7a78ebdf091898b
2026-06-08 19:23:56 +00:00
drh
b9e656f6f7 Fix a faulty assert() in rtree that could fire when processing an unusually large record.
FossilOrigin-Name: 004d85c5f1bf04409ce85d5131f1d9697f25f531046e60160e78b0bae7f55123
2026-06-03 16:58:01 +00:00
drh
c867ce4b89 Use tail recursion on the larger of the two partitions when doing a
quicksort as part of the implementation of the median() function,
to avoid excess stack usage on pathological inputs.

FossilOrigin-Name: b8fce837cf633af7e489e9750bcd1764e96f9ad7ea01847d5ef9c7060f01a4bf
2026-06-03 16:23:45 +00:00
drh
ceb66403bb Fix an integer overflow problem in fts3 that could lead to a buffer overwrite on platforms where size_t is 32-bits.
FossilOrigin-Name: 1389ec7bf6a7f68406adae6fd532497b2496f01fb5b465e18bd683da3f8f53ad
2026-06-03 15:54:58 +00:00
drh
6c1aa834f6 Fix another buffer overread in fts5 that could occur when processing
corrupt records.

FossilOrigin-Name: 8427cac76455ecbef224ceaccbb37b79338015bcfe67209ae462f36ffefa8466
2026-06-03 15:02:29 +00:00
drh
e7d405200a Fix another potential buffer overrun that could occur in fts5 when
processing corrupt records.

FossilOrigin-Name: e583a723fa501d0c53ad124b571bcd6a42d76daba1ea983d3a547763c2c94c22
2026-06-03 14:24:19 +00:00
drh
c911dda3d3 Fix a potential UAF bug in the zipfile extension.
FossilOrigin-Name: 46fbc23c16b3d104605f5abe5d7a5e779021e264bde409f2d9939de9b5cb9b37
2026-06-03 13:16:20 +00:00