Commit Graph

5376 Commits

Author SHA1 Message Date
dan
bae4055493 Fix a buffer overrun that could occur when deleting rows in secure-delete mode from a strategically corrupted fts5 database.
FossilOrigin-Name: 3a24bf9374a04822505ef6db29374a107956c27a70fe5f6c2b468f8df8466dd4
2026-01-15 17:15:30 +00:00
dan
248ee2f7cc Avoid unsigned integer overflow in the delta_apply() extension function.
Not part of any standard deliverable.  
[forum:/forumpost/d41879b367c7f7ec|Forum thread d41879b367c7f7ec].

FossilOrigin-Name: 693c90a7aa33f2c3cee978773c614ccc7830633341bf53924e84a21c7e28b091
2026-01-15 17:12:57 +00:00
dan
5ba53751af Prevent a malicious delta from causing an integer overflow in the
fossildelta extension.  This code is not used in the SQLite core.

FossilOrigin-Name: 1f4e32e2e3985d2ccb56c87794f04557bc451e2d75b28667908d3dc6842678a2
2026-01-15 17:11:33 +00:00
drh
15cd670486 Fix integer overflow problems and error reporting memory leaks in
the zipfile extension.

FossilOrigin-Name: 325c222726f275f14c1cbf82fc8ee4e60d07e87daaaa9674d050d1e82f85902c
2026-01-13 02:39:52 +00:00
drh
c51f318f6a Avoid signed integer overflow when an fts5 'merge' command is passed -2147483648 as a parameter.
FossilOrigin-Name: 127b3270f8716e0eda06ea6979def88283e15aecdceb5d56c82105b300c98bdc
2026-01-09 16:01:51 +00:00
drh
3a621d8a58 Fix potential OOB read on the undocumented test function rtreenode() in
the RTREE extension.

FossilOrigin-Name: f567ea96905ec58bb073b675e820ba505d3306338fdefd64bdd5cf965a3a9e88
2026-01-09 00:45:41 +00:00
drh
632632ced3 Use 64-bit integers to track memory allocation sizes in the CSV extension.
FossilOrigin-Name: 54398a2504a8a2ac47a461518df51406b29e63f1688f6ec108a41ac7b4b346f9
2025-12-31 18:46:13 +00:00
drh
bc9cebcd1d Use sqlite3_malloc64() in all places in the compress.c extension to avoid
integer overflow.

FossilOrigin-Name: 15400ce39b83ebc384b5eb17eba87452b937c0b00117c1575a51c6e6139fe3b1
2025-12-31 10:59:40 +00:00
drh
2b0579b06b Fix a typo in check-in 0819fe670f9ceec7 that lead to incomplete protection against
buffer overflow in the zipfile extension.

FossilOrigin-Name: a3f135c0709b2ed2953d2e449107abc53b538b384bcd9bae5e370e3c9de8618a
2025-12-31 01:11:36 +00:00
drh
323199b57e Fix a memory leak in the fileio extension on windows. Other changes to
makefiles and similar to get zipfile testing working on Windows.

FossilOrigin-Name: 121b327f1f3941a9a44ab2d98e60f6e25b928ca9b54bbaa109239ba9012b3c3c
2025-12-19 23:47:07 +00:00
stephan
e20e6f59c2 Fix a potential UAF in sqlite3.oo1.DB.exec()'s teardown pieces.
FossilOrigin-Name: 59e0b8a2812f9969402a719174506a20a231a66a15818e6e8830956de2d365e6
2025-12-01 19:20:20 +00:00
drh
d261437615 Fix a buffer overread in fts5 that might occur while processing a corrupt db.
FossilOrigin-Name: 712e31c59254f82e62a19e41d3b6ac15391dd6e9df966cacadfa9ae79415b243
2025-11-28 12:36:04 +00:00
drh
8c7f142470 Fix a problem in the xFilter() method of the fts5_vocab virtual table causing it to omit some result rows in some cases where a virtual cursor is used more than once by SQLite.
FossilOrigin-Name: 0c836387518dee719eaac8992c63da955630ac073a5e4ba4d887160dff42b898
2025-11-28 12:00:14 +00:00
drh
de223ffbbd Merge various minor code and documentation fixes from trunk into the
patch branch for 3.51.

FossilOrigin-Name: 9a00fe5eb69050ddc569d2a857309c2779a48414135f0967531999b7afd84283
2025-11-13 11:34:38 +00:00
stephan
ea0cda00d6 Kick off branch-3.51: bump version to 3.51.1 and cherrypick [0f712b6b0516dc151d].
FossilOrigin-Name: 1b908c439a4d2614cb6a4cec36d8d876eec68b1e2e80d6aad7e21d61d159df7d
2025-11-09 06:38:48 +00:00
drh
eaacb4ac37 Add pedantic OOM detection logic to some disused diagnostic and test code.
No changes to any deliverables.

FossilOrigin-Name: abb6945fc62a1855786bda1f473edef0e937a791c453387a0859a6ce0451635a
2025-11-02 22:57:26 +00:00
stephan
e5c8467a8e Fix ext/wasm/mkdist.sh to use ./version-info instead of ../../version-info (a recent build change made to ensure that builds with a custom sqlite3.c embed that version info).
FossilOrigin-Name: d25a92d88923f880d6477a99f2a35528faea83e7db245f2b07db80613b4aeb8e
2025-11-01 14:49:05 +00:00
stephan
3a61466a2f wasm: re-add SQLITE_OMIT_WAL to the c-pp-lite build flags.
FossilOrigin-Name: 617f8ac40e073c3fdc1144639b78617ad61113f4e873fc20c99399d2b60e1ceb
2025-10-30 18:39:28 +00:00
stephan
7c86a0321e Remove an OMIT_WAL from the wasm build because it breaks with the current amalgamation (and isn't strictly needed here anyway).
FossilOrigin-Name: a7be7d155aa6f02075f939ab6d26cfdfe2d0832b59da39c8bf4a74fc4845bd05
2025-10-30 01:43:30 +00:00
dan
8ce786f173 Fix sanitizer complaints in the regexp extension.
FossilOrigin-Name: 6ff9ecb89d769bc2a27f8a57130f28ec7478979d3e35ba765c16017b5bdf775d
2025-10-27 11:20:47 +00:00
stephan
6b9230d2a1 Merge the OPFS/SEE tests into trunk (where they should have been committed).
FossilOrigin-Name: f8a4d7abf0d1c9c92fa102165d08aed76fd766d49615e3d347b5547580355574
2025-10-26 21:58:41 +00:00
stephan
d4ead9b9e4 A better/cleaner fix for [1c80ff88c0ce].
FossilOrigin-Name: 6138043bdde09224a764b5d5f18a9e2776c761c424f41b0d69427d92d47ec41c
2025-10-26 18:36:57 +00:00
stephan
f57d368078 c-pp-lite: Fix another newline-related off-by-one which could cause newlines to get lost in @token@ filtering. Problem found in out-of-tree testing.
FossilOrigin-Name: 1c80ff88c0ce3d1c168c9bda734cf52114c35efdcf46a6da78f0ed9adc794eb8
2025-10-26 17:59:30 +00:00
stephan
be4d0c2e2f Make it particularly clear in the wasm build output that unsupported builds are exactly that. Cosmetic tweak only, no functional changes.
FossilOrigin-Name: 86f53a2eb37d8ec98bc9d4c6b00253cc00d798e79c7d409e65d608354a556e19
2025-10-24 20:29:12 +00:00
stephan
3ba506d9cc ext/wasm: dependencies fix for parallel builds attempted immediately after a distclean. Add version-info to the distclean rules.
FossilOrigin-Name: b99233fe3d901714c4369ba25c510050fb7a8a85c1168780108595e9639a6d15
2025-10-24 16:39:58 +00:00
stephan
67fa337744 ext/wasm/GNUmakefile: (A) When using a custom sqlite3.c, use sqlite3.h from the same directory instead of the top of this tree. (B) Re-add preprocessor flags for SEE which were misplaced during recent build refactoring.
FossilOrigin-Name: 1b1e530a9149ce62d3d53f5c558e358d4e6d1b00e0cce8bb04cb6b13d1841538
2025-10-24 16:25:23 +00:00
drh
033dbac510 Fix [4e713558f6c6ea3d] so that it supports separate builds of rtree.
FossilOrigin-Name: d030e955d703772e1637ef2c07d29816fc869ead0a15a85ec8b4633e5ca08e0a
2025-10-24 16:01:55 +00:00
drh
acdda1075d Enhance the tokenizer so that it is able to deal with individual tokens
larger than 2GiB.

FossilOrigin-Name: 4e713558f6c6ea3dfbc97d2eb0a328955ef6ad6f2ad05517efe9ed4a60181440
2025-10-24 13:18:31 +00:00
drh
4043096408 Additional defenses against over-sized inputs in the (unused) amatch.c
demonstration code.

FossilOrigin-Name: b9f6ae0767ce5d9cbc6fca6d63c929f919473fa669e50a0a460627e5fde2628c
2025-10-23 14:05:58 +00:00
drh
d06a0be514 Fix a faulty error message in the ext/misc/fileio.c extension.
FossilOrigin-Name: 1fdef271cd15d0960a7933253a10f288e26771cdcf34b5cd22adbc49d6341bc5
2025-10-23 13:10:34 +00:00
drh
efe8ae567c Use 64-bit memory allocations everywhere in the expert extension.
FossilOrigin-Name: 6caf793b8f406f5089e3811591bc69384646df16ee18d63bd63760eaaa95d122
2025-10-18 11:19:02 +00:00
stephan
6eaeea0a3b Fix an off-by-one in c-pp-lite.c which could cause @token@-processed output to get one duplicated byte.
FossilOrigin-Name: aa2f4c51604f4d4286c8a1ec7eaa6251892471e32087af695712513ee620ea46
2025-10-16 01:44:03 +00:00
stephan
e826aa8e00 Minor JS doc updates. No code changes.
FossilOrigin-Name: fc2a026901b1a12526b92fff36d7acc226e554c9f351e6261c7ffd4887bcc337
2025-10-15 23:28:31 +00:00
stephan
ff5d4c348c Resolve a valgrind-reported error in ext/wasm/c-pp-lite.c caused by successful exit colliding with the atexit() handler. Add -e SCRIPT support to c-pp-lite to facilitate testing.
FossilOrigin-Name: 7801c7225a18ccb2216b01663b30e3eb90a961e3d165af73f964c515b74fe745
2025-10-15 23:13:50 +00:00
stephan
d6cb2ccee6 JS/WASM: Expose sqlite3_db_status64(), sqlite3changeset_apply_v3(), sqlite3changeset_apply_v3_strm(), and SQLITE_DBSTATUS_TEMPBUF_SPILL.
FossilOrigin-Name: b13eafc9b6820517b450041a7e2be573a896b5b9e88b2b28df9f15e3cb91e23d
2025-10-14 18:23:32 +00:00
stephan
4472c967a6 Fix two links in ext/wasm/README.md.
FossilOrigin-Name: 0f96eaeaa8c51c20f8d389bfd6d0d6371e8bb29ff7e8eaf3a0bcb35cb2b73338
2025-10-14 14:07:58 +00:00
drh
abe709be8d Extra defenses against integer overflow in the decimal extension.
FossilOrigin-Name: 1a7414d9b5be7ce18b23c357fd98cd0e96d78ac626abfa6e4e0dee494b6a1efc
2025-10-14 14:03:09 +00:00
stephan
5dbbe50758 Add a section to ext/wasm/README.md about the dependency on wabt/wasm-strip for release builds.
FossilOrigin-Name: 0dbb13863b3ff1da1be664967ac05c79cf34f7a78def05fe4f6407c06cb4322a
2025-10-14 13:47:40 +00:00
stephan
9f136fc5ed Fix a makefile typo which caused a build directory to not get mkdir'd for the fiddle build.
FossilOrigin-Name: d98d5abf6d27c5359ff8c797ad57394b96074e47010bc4c24120ba69a967dc3c
2025-10-14 13:25:02 +00:00
dan
264bcad69a Avoid integer overflows (a) when dealing with zeroblob(N) calls when 2*N is larger than 2^31, and (b) in fts5 when a corrupt record is close to 2^31 bytes in size. Both of these require special builds with SQLITE_MAX_LENGTH set to a non-default value.
FossilOrigin-Name: 27927519696dcb78ff72e245158ea6d33a1b2c3d4da314d4d0283c47d847c3da
2025-10-13 16:07:28 +00:00
drh
e4eaf174a5 Remove an unused variable from the generate_series implementation.
FossilOrigin-Name: a523e4adbf8e60ea8c3351f33aff793c6e425c594038e8578d12564bf47aac03
2025-10-11 18:44:54 +00:00
drh
11878165f6 Improvements to the (rarely used) home-grown varients of seriesCeil()
and seriesFloor() based on ideas from
[forum:/forumpost/2025-10-11T12:36:56z|forum post 2025-10-11T12:36:56z].

FossilOrigin-Name: e6b9bfdb6f8f86d4d2891d65fee4274dcbc61c9e998d81f90232153c05788cab
2025-10-11 15:45:47 +00:00
drh
5013fd1f81 Provide alternative implementations of ceil() and floor() to the
generate_series() function so that it will build even when SQLite is
compiled using --disable-math.
[forum:/forumpost/91690fa646|Forum post 91690fa646].

FossilOrigin-Name: 97d6fd2c99578adb6a1e9b879ba5ae5ad798a8ef8f0646bf0102747d52148bff
2025-10-10 19:43:03 +00:00
dan
eeb2e03b7b Back out [8bf26c956e]. It is not required following [8e7da8cf50].
FossilOrigin-Name: ea29180797aa4bb25180432e75a372277a6f6e2262906a9e765a3bddf8ca79d7
2025-10-10 16:04:19 +00:00
drh
80f0fcd31d Fix harmless compiler warnings.
FossilOrigin-Name: 4966d7a1ce42af8b1c50fdd40e651e80d0eeb8cb62dd882950cab275f98aba88
2025-10-10 14:31:46 +00:00
stephan
b4fdfc2f9a Update c-pp.c and rename it to c-pp-lite.c to match its new upstream name. Adapt the JS files and mkwasmbuilds.c for c-pp syntactic changes.
FossilOrigin-Name: bb13e46ddfcd1d3ca73845430d9a91c0ea3913762d39bbd94127783d77e4f63b
2025-10-09 15:28:59 +00:00
dan
40d299ae32 Avoid corrupting the fts5 index if a value that was inserted via sqlite3_bind_blob() in a non-utf8 db is deleted.
FossilOrigin-Name: 8bf26c956e199762d55c159392c2e3813a9e12b914d3ca33000bf332cd946cb0
2025-10-09 14:50:27 +00:00
stephan
0df9db4921 Make use of the new SQLITE_ENABLE_PERCENTILE in the wasm build.
FossilOrigin-Name: 937c084c2d9b20fde2d54e48257cb7018bd8c36d6f00ed6f1659b5ecc2f48ed4
2025-10-08 18:17:19 +00:00
drh
cdaff852bf Were we to choose to integrate the carray() table-valued function into the
amalgamation, that integration might look something like this.

FossilOrigin-Name: 2b43d5d7dcc5aee14a050c824a5e09b6a38a9c78ddcc25a994eba5d4c5ad9ba2
2025-10-08 15:32:55 +00:00
dan
6147a0f6a1 Add test cases for the carray module.
FossilOrigin-Name: dcfc0164a95eddb5e924c606850fe2015e8f2f516d36b380cbb79d6bdfe034fc
2025-10-07 21:02:37 +00:00