drh
bfbeb641de
Fix parsing of quoted instantiation arguments in the spellfix extension.
...
[bugs:/info/2026-06-26T10:52:36Z|Bug 2026-06-26T10:52:36Z]
FossilOrigin-Name: c2e963ad948e0c244d6b883b919ec0815c20018282e04e5649c00e70f5a1d2ed
2026-06-26 13:51:48 +00:00
drh
0a54af99a1
Fix unbounded whitespace skip in the decimal extension.
...
[bugs:/info/2026-06-26T10:06:54Z|Bugs 2026-06-26T10:06:54Z]
FossilOrigin-Name: 71d4cfe5a34cf8485ab2e5abe670381cd068f013233d98c44355a6bcdfcbbbb0
2026-06-26 13:41:07 +00:00
drh
c288de339c
Extra margin to prevent queue overflow in the RTree extension.
...
[bugs:/info/2026-06-26T12:15:33Z|Bug 2026-06-26T12:15:33Z]
FossilOrigin-Name: de40bfb6b39f3252d1dc2dccc04439ac7b40c1331ded60473950cb4b96fc85f7
2026-06-26 13:21:00 +00:00
drh
8cb5703867
Fix the (non-deliverable, testing-use-only) closure extension so that it
...
parses quoted instantiation arguments correctly.
[bugs:/info/2026-06-26T10:06:27Z|Bug 2026-06-26T10:06:27Z]
FossilOrigin-Name: 11ffa3bfba77b9f3a8c4903d496f63ee26c9873f735d254f35111eecf91228be
2026-06-26 13:00:38 +00:00
drh
040b521c7e
Mark the diskused() extension SQL function as direct-only.
...
[bugs:/info/2026-06-26T10:52:15Z|Bug 2026-06-26T10:52:15Z]
FossilOrigin-Name: b66292820ad17b54eb5f0a48ef9ff01a1b52efd8004307c6faeeb4687ab50567
2026-06-26 12:34:22 +00:00
dan
5ef70c142e
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. Bug [bugs:/info/2026-06-26T08:08:39Z | 2026-06-26T08:08:39Z].
...
FossilOrigin-Name: df5728d79ff09235041cf01267104f29f482af3473f5a4c849133b6048565725
2026-06-26 11:36:54 +00:00
drh
e28c7bfec9
Improved detection of corrupt freelist chains on btree pages.
...
Plus, add assert()s to verify that the min-heap does not overflow
inside of PRAGMA integrity_check.
FossilOrigin-Name: 942498724f5bb83b9a7d9bbbea662d152a46a0ccaee26e4b291f090cc6e7d178
2026-06-26 09:55:59 +00:00
drh
02ea41d524
Check super-journal names for validity earlier, as this simplifies
...
verification that the logic is correct.
FossilOrigin-Name: 6ba9e19430092aef59f2a7ab6fb7bdacacbb85988f41c155a5af490b0d8a8270
2026-06-25 20:26:17 +00:00
dan
426c44c0a4
Have API functions sqlite3_serialize, sqlite3_limit, sqlite3_busy_timeout, sqlite3_error_offset, sqlite3_db_name, sqlite3_get_autocommit, sqlite3_errcode, sqlite3_total_changes64, sqlite3_changes64, sqlite3_last_insert_rowid and sqlite3_expired take and hold the database mutex while running.
...
FossilOrigin-Name: 7bfd5c810c6f04ddfd275457a2a03b4da0c3e7d4ee5acb61a54d805e2e67f819
2026-06-25 17:07:53 +00:00
dan
79e94a4df7
Also have functions sqlite3_db_name(), sqlite3_get_autocommit(), sqlite3_extended_errcode(), sqlite3_errcode(), sqlite3_total_changes64(), sqlite3_changese64(), sqlite3_last_insert_rowid() and sqlite3_expired() take the database mutex.
...
FossilOrigin-Name: 46509e48d3049a1ca52d9cc3f023634a651cd633d36bd9056ca0172759ba201e
2026-06-25 16:24:06 +00:00
dan
5b6097d87f
Have API functions sqlite3_serialize(), sqlite3_limit(), sqlite3_busy_timeout() and sqlite3_error_offset() take the database mutex.
...
FossilOrigin-Name: fff2c37b9fabbbad20ace60a00e521d198a53125e371f8956275d89eb3c0f32f
2026-06-25 15:47:42 +00:00
drh
c07e6ad039
Change the undocumented and unsupported sqlite_log() SQL function so that
...
it is marked as unsafe and direct-only.
[bugs:/info/3311f8d5b8|Bug 2026-06-25T10:19:43Z].
FossilOrigin-Name: c30ea3cefe346a3d87b57710a51b059371543c5abc75d08c4ca827bbe3b3f622
2026-06-25 15:17:15 +00:00
drh
eac3240484
Improve the sqlite3_str_vappendf() routine for additional robustness in the
...
face of over-sized inputs.
Probable fix for [bugs:/info/2026-06-25T11:29:23Z|Bug 2026-06-25T11:29:23Z].
FossilOrigin-Name: d7e4b2a85f81dacfee497d806bbc9f8c262624bd618aa27d4d238191643a4f5d
2026-06-25 14:48:09 +00:00
dan
07607c69b4
Have sqlite3_drop_modules() take the database mutex. Bug [bugs:/info/2026-06-25T12:11:37Z | 2026-06-25T12:11:37Z ].
...
FossilOrigin-Name: 533e59b40c4ce6b3579cb85deb9cb1a7179aa2cf4f91d8848558087869653a76
2026-06-25 14:25:15 +00:00
dan
a3e4156745
Add test case to backup5.test to verify that detaching the destination database from its handle is handled correctly.
...
FossilOrigin-Name: 50cce4758361379f1585b30c619f2c9f7f8873dbfaeaec3ff357e26c1034546c
2026-06-25 10:36:51 +00:00
drh
3d173f4b25
Fix a harmless false-positive compiler warning on Windows.
...
FossilOrigin-Name: dae75754693143603c8fc9df3f0046dec3577e17a2858e877d238dd0f46899f4
2026-06-25 00:15:26 +00:00
drh
bcb259c17c
Alternative to [15a6482300bb2804] that is testable.
...
FossilOrigin-Name: 847e6a657451182be73816444c5e6f0e099dacf2cc8b99669e3b96f83dd51117
2026-06-25 00:09:14 +00:00
drh
aeebf257eb
Check for cells extending too far past the end of a page while search
...
an index. [bugs:/info/2026-06-24T14:55:57Z|Bug 2026-06-24T14:55:57Z]
FossilOrigin-Name: 6d0696706a9e2f70229b2db52f053e540fe0a89290a6c57f23ec0c8bd7a49213
2026-06-24 20:20:57 +00:00
drh
878bfb2cf2
Remove ALWAYS() and NEVER() macros used for developmemt testing on
...
this branch.
FossilOrigin-Name: f3532fc55a2be273acb97023165e96817c291576a9d6d45f8d6e7ae57adbd577
2026-06-24 20:17:20 +00:00
dan
27ab7ff606
When rolling back a journal that contains a super-journal pointer, only attempt to unlink the super-journal if (a) the filename looks like one that SQLite might have generated, and (b) the super-journal contains the name of the journal being rolled back. This is to limit the extent to which SQLite can be caused to delete arbitrary files by supplying it with a crafted hot-journal. Report [bugs:/info/2026-06-24T14:18:00Z | 2026-06-24T14:18:00Z].
...
FossilOrigin-Name: 6d8da8861c8ccbfdbe838587dc2f5ef1817bc0af4a6167940446ee7bdc53955c
2026-06-24 19:28:55 +00:00
dan
57312eb362
Update mjournal.test so that it works on windows.
...
FossilOrigin-Name: 6007b5c2d3c27a4597631914d4114b626ba647954ecfb381de67d4cf27d31ccd
2026-06-24 19:07:30 +00:00
dan
171b1cfb9b
Only delete a super-journal if it contains a pointer to the current database's journal. Test cases in this commit might be broken on some platforms.
...
FossilOrigin-Name: c768be03d4885557c9520c37e3cecbf5647d358a87cd34948578a4a0a8a59a5e
2026-06-24 18:51:36 +00:00
drh
2740a0a1fc
Check for cells that extend of the end of a page when searching indexes.
...
This is a work-in-progress.
This check-in includes four NEVER() and ALWAYS() macros for which simple
test cases are needed.
FossilOrigin-Name: 27ffb3eefede00e1caa51684c82e0aefa2a86ab3d00aa23874be9afc75c2a8b4
2026-06-24 18:50:44 +00:00
dan
c0121a43ac
Do not delete super-journal files named "xyz.9hh" unless the library is built with SQLITE_ENABLE_8_3_FILENAMES.
...
FossilOrigin-Name: 3973e37a1ef528676de44ddb1b1f18d55b90fca1f6b43c51c3f3ba613267bb92
2026-06-24 18:03:20 +00:00
dan
e21a8d7d1e
When rolling back a journal that contains a super-journal pointer, only attempt to unlink the super-journal if the filename looks like one that SQLite might have generated. This is to limit the extent to which SQLite can be caused to delete arbitrary files by supplying it with a crafted hot-journal. Bug [bugs:/info/2026-06-24T14:18:00Z | 2026-06-24T14:18:00Z].
...
FossilOrigin-Name: 0cdde6755837935e4feaa4367a0b107e363582adc8112a91dc7416f1100ae3aa
2026-06-24 17:14:57 +00:00
dan
1968870813
Avoid trying to delete a database file while it is still open in backup5.test.
...
FossilOrigin-Name: 395cbed103af08e3a4fafd9a3041205535e019d4aeb58b46c4a7e4f3bca545c9
2026-06-24 14:17:52 +00:00
drh
c6caa0eb6f
Fix a comment in os_kv.c so that it does not match "###" and thus does
...
not cause false-positives when searching the output of gcov. No
changes to code.
FossilOrigin-Name: 5482548b6bca2827246cd2cc928c89a953365da5ebe42d3a2876371ec6880f1b
2026-06-24 13:46:37 +00:00
drh
2ae4d56c05
Fix the sqlite3ParseUri() for improved defenses against ridiculously long
...
URI inputs causing integer overflow problems.
[bugs:/info/2026-06-24T11:46:39Z|Bug 2026-06-24T11:46:39Z].
FossilOrigin-Name: 140a693ee0c0cfa8f332cd1bbdfe045c016e4bf5169d6dd94648cbe38d7517c6
2026-06-24 13:45:04 +00:00
dan
9d60ae2b73
Revert the fixes to backup in [1f940357f7] and [e5db80350c] and instead fix the problem reported by forum post [forum:15d82885e2 | 15d82885e2] (that a call to sqlite3_deserialize() after sqlite3_backup_init() but before the first call to sqlite3_backup_step() on the destination db of a backup could cause a crash) by deferring caching the pointer to the destination Btree until after it is locked. This addresses bug [bugs:/info/2026-06-24T08:41:13Z | 2026-06-24T08:41:13Z].
...
FossilOrigin-Name: 18da5759590793c934184a6f1e28fe61a9714f305f1e9704061364325c0bbf9e
2026-06-24 13:42:39 +00:00
dan
d0a79d8447
Remove a stray C++ style comment left in build.c by the previous commit on this branch.
...
FossilOrigin-Name: bfce01a4b06b5f3bfb050bf15e25919a6c85b3ec0002acd016ac8c5ffa500daf
2026-06-24 13:37:31 +00:00
drh
d87f8c4965
Defend against integer overflow on oversized string inputs to
...
sqlite3_mprintf() and similar C-language interfaces when using
the "%!.*s" conversion. The problem is not reachable from SQL
due to string length restrictions in SQL. C-code is required.
[bugs:/info/2026-06-24T11:57:36Z|Bug 2026-06-24T11:57:36Z].
FossilOrigin-Name: 15a6482300bb2804fbfad1f07d6d74da6c0cb5953d44b74bc61c17d29e29821c
2026-06-24 12:40:26 +00:00
stephan
b1541d2f17
Back out [23936786e6] because [9725b513c0] obviates it.
...
FossilOrigin-Name: ef5e415303aeeaad65987871302380e96704316daf89ab5e96330798e4cbe1ce
2026-06-24 12:23:29 +00:00
drh
40ffc41dab
Update documentation to explain that a odd nByte parameter to
...
sqlite3_prepare16() is undefined behavior. In addition, always round
down the nByte parameter to an even number so that it in fact harmless
to give it an odd nByte value.
[bugs:/info/2026-06-24T11:25:24Z|Bug 2026-06-24T11:25:24Z].
FossilOrigin-Name: 7af7c501b60358cf84e843eb147e6edf9a5aaca30b1c570abe63ca68b54e3ec2
2026-06-24 12:22:22 +00:00
drh
f6f2009394
Fixes for SQLITE_OMIT_FLOATING_POINT.
...
FossilOrigin-Name: 9725b513c0b9fe488289ac42db59af29b62ac7551f5d1de5064147ec3ca4a2fa
2026-06-24 11:51:35 +00:00
dan
ade8954c40
Revert the fixes to backup in [1f940357f7] and [e5db80350c] and instead fix the problem reported by forum post [forum:15d82885e2 | 15d82885e2] (that a call to sqlite3_deserialize() after sqlite3_backup_init() but before the first call to sqlite3_backup_step() on the destination db of a backup could cause a crash) by deferring caching the pointer to the destination Btree until after it is locked. This addresses bug [bugs:/info/2026-06-24T08:41:13Z | 2026-06-24T08:41:13Z].
...
FossilOrigin-Name: 44a0f396daa13f382fd839cd8be49148aa24114968b97fed7f365307d1f8280a
2026-06-24 11:50:08 +00:00
stephan
097d2f293f
Swap two lines to get the amalgamation building again with SQLITE_OMIT_FLOATING_POINT, noting that neither the shell nor the canonical library build with that flag. Reported in [forum:8c3df4da0d|forum post 2026-06-24T07:21:05Z].
...
FossilOrigin-Name: 23936786e680131af644510eb50b7ad20ee39221d1fb29732dea76483aed2273
2026-06-24 10:22:36 +00:00
dan
99a92ee66d
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: e458ed9cc9d46dfdade3b4e99eb209d8aefd40a245e002d68df1813f9f99e2d7
2026-06-23 20:12:17 +00:00
dan
e9467c1b4a
Fix sqlite3_backup_init() to correctly handle the case where opening the temp database fails.
...
FossilOrigin-Name: c08bb97f399447be767ca2932858d88db5c1ba6ba29a68b1def23957206f9883
2026-06-23 19:46:48 +00:00
drh
ce512d4229
Fix an OOB read on the unused spellfix1 extension. The OOB read is
...
one byte prior to the start of an allocation, which is almost always
harmless. [bugs:/info/2026-06-23T18:48:40Z|Bug 2026-06-23T18:48:40Z].
FossilOrigin-Name: e58d5efc7b3387566661475e1a9afb6b94388a835cfb178999603135d57280fa
2026-06-23 19:28:14 +00:00
dan
764881119d
Avoid a use-after-free problem that could occur if ATTACH statements are executed while a backup operation is active. Bug [bugs:/info/2026-06-23T15:46:48Z | 2026-06-23T15:46:48Z].
...
FossilOrigin-Name: 9454592878b5732d37d61f4541bd6f0c1f893c20fc833ce4c600f9470e62d6f2
2026-06-23 19:14:44 +00:00
drh
72d26f4660
Do not allow internal-use-only functions to be coded, anywhere, unless
...
inside of a nested parse (which is the case for ALTER TABLE) or if
the appropriate test-control is activated.
[bugs:/info/2026-06-23T15:49:27Z|Bug 2026-06-23T15:49:27Z].
FossilOrigin-Name: a145307e4d0b621c5493cecc7c826e8422cbd8dbc8cd9a042b8ec9e05d389eb6
2026-06-23 19:08:18 +00:00
drh
b568fc21d8
Fix a typo in a comment. No code changes.
...
FossilOrigin-Name: 8a535a36a90cf12b783469289a882d1313038d444b4a7f04e3495ae9bdec416d
2026-06-23 15:35:29 +00:00
stephan
a930017a6b
Makefile doc tweaks. No functional changes.
...
FossilOrigin-Name: d85204bbd92f362c5c7d744d59f7be6923cdbf1f15f7220e70af4090161c24c2
2026-06-23 14:11:16 +00:00
stephan
f822af35e4
Improve robustness against corrupt kvvfs journal files. Addresses bug report [bugs:f4d88886e6|2026-06-23T06:51:34Z] and the first follow-up report in that thread.
...
FossilOrigin-Name: bd24ea4d76c8d6816ac5177593ee3427b71b0508b5cdc804c29b2ed25405b9c8
2026-06-23 13:26:35 +00:00
dan
db6eeee50e
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. Bug [bugs:/info/2026-06-23T05:32:49Z | 2026-06-23T05:32:49Z].
...
FossilOrigin-Name: 3a2163f9693086bc494ac899647f09467b1aba905f4db147910f203aaab724f0
2026-06-23 11:14:45 +00:00
drh
dd9b3e37e1
Fix a NULL pointer dereference that can occur when misusing a extension
...
virtual table that was created for testing purposes.
[bugs:/info/2026-06-23T05:32:49Z|Bug 2026-06-23T05:32:49Z]
FossilOrigin-Name: 256d5cd478b83b1371ce24c9702f732cddb4dd4e06c238fc1a1b853b02ffc1f1
2026-06-23 11:09:55 +00:00
drh
987675a440
Fix an OOB read in the next_char() function of the
...
"spellfix" extension. The spellfix extension is not a deliverable.
[bugs:/info/2026-06-23T05:41:00Z|Bug 2026-06-23T05:41:00Z]
FossilOrigin-Name: 6ede22e13f8e85c1a341c9a80a3be2f2677baee897c659af4ca43a04698e29a5
2026-06-23 10:51:24 +00:00
drh
b7862a55ef
Fix dequoting error on the instantiation parameters of the
...
non-deliverable extension virtual table "fuzzer.
[bugs:/info/2026-06-23T05:51:36Z|Bug 2026-06-23T05:51:36Z].
FossilOrigin-Name: 410045796b4486fc2d301e661bf9fce3ca3a1ba61c72fe5d6c5d59a330443dd5
2026-06-23 10:23:08 +00:00
drh
3c0d684044
Fix rounding behavior for all-9s decimals in the decimal extension.
...
[bugs:/info/2026-06-23T05:07:48Z|Bug 2026-06-23T05:07:48Z]
FossilOrigin-Name: 21b2692c8363f2c0629beef4860400a1d27f499a3f27745c23391bcfa09da898
2026-06-23 10:07:50 +00:00
dan
eb6eac655e
Add the BTREE_HINT_TABLECURSOR cursor-hint. This is not currently used by stock SQLite.
...
FossilOrigin-Name: 35b3ff4007fc1abd36233a6b3b75bb6a123edc062f36437247c3dfe779868b70
2026-06-22 11:02:28 +00:00