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
stephan
a89d43e5db
Correct test from [96a48a15760a] - that journal was indeed corrupt, but not in the intended manner. Add a verification that the bad journal gets replaced after a write.
...
FossilOrigin-Name: c9171221160f241b450d425f41bb53b42362dccfad4c3fdf64dd5c3562ed4096
2026-06-21 11:38:05 +00:00
stephan
646931b83e
Extend the test from the previous check-in a bit.
...
FossilOrigin-Name: bd6bbd0e84226c90d864c28ac4d6acd908c4f06bfe63dcfd6fa6b8d17105b338
2026-06-21 11:10:17 +00:00
stephan
9be4c57ca1
Add a JS test demonstrating that [7c4db1cd2d06] recovers gracefully from journal corruption.
...
FossilOrigin-Name: 96a48a15760a2eee2642926874e9dfd4082518c6669f930fcc367ffd16669f39
2026-06-21 10:55:09 +00:00
stephan
d7e055d41c
Fix a result value semantics bug which broke application of a journal in kvvfs. Fix a memory-reset bug in hypothetical non-WASM builds of kvvfs. Bug report [bugs:7fcd3ea30fa4fcfc|2026-06-20T18:22:59Z], and this resolves the journaling issue mentioned in the parent post.
...
FossilOrigin-Name: 7c4db1cd2d06d9dc6c4b5eed5c4fc0fc5466128a169a5d4ba261e0cb17020ae1
2026-06-21 08:38:07 +00:00
stephan
97467fa8fa
Fix a potential integer overflow when decoding a corrupt kvvfs block. Bug report [bugs:76acc88b57|2026-06-20T18:35:54Z].
...
FossilOrigin-Name: c36fc5df62c7eb8fca6a43cb0b3154a030b39a4cfade8fb04496120d4d339b97
2026-06-21 08:13:22 +00:00
drh
fb41f57de4
Fix an incorrect assert() in check-in [984c9b181801c1de]
...
FossilOrigin-Name: 1d41c93b3636de63cc4b9ee49f73319429944f2255ab56d7556595f56434c17c
2026-06-20 21:54:18 +00:00
stephan
190034d268
Correct misuse of a loop control variable in writing of a kvvfs journal. Bug report [bugs:20e208fe17|2026-06-20T08:49:41Z]. Remove a snippet of dead code in the JS kvvfs side.
...
FossilOrigin-Name: a396d7c54c5f251daaaac1e68321c2a54d3b6969599027c29b7ca7abe7fb8c4e
2026-06-20 11:07:04 +00:00
drh
ae3c30e318
Add the sqlite3_result_str() interface and use it to simplify the code.
...
FossilOrigin-Name: 8f8361edf82233d6cd53bf8cd2f7fbf0cb3552228c9202395ef1e3383ed559ff
2026-06-19 23:53:29 +00:00
drh
7644162026
Use SQLITE_FINISH in a few places in the core, to help ensure that path is
...
well tested.
FossilOrigin-Name: 7356bf3a813bcd9082a7fdef5e2cc38c7a0f142f0ef4c948f78e4dafa216c039
2026-06-19 22:57:44 +00:00
drh
fa8e52021f
Put the sqlite3OomStr singleton in "const" space to ensure that it is
...
never modified. Doing so identified a long-standing bug.
FossilOrigin-Name: 2fe53e6d68c3f9f1c4b064fa40fe8efe12025179a973182f0bb256acb9b5d58d
2026-06-19 22:17:09 +00:00
drh
ec4f18fed8
Additional changes based on Claude analysis.
...
FossilOrigin-Name: d4691a0db1e96b646d3094f183b1fc330411a2d2472b09f9b5fe0fb268b5ca09
2026-06-19 21:43:04 +00:00
drh
9487f6d441
Further refinements and uses for sqlite3_result_str().
...
FossilOrigin-Name: 974253a6058a7120354261b2134ed4803373031996957c7334161370b80bf428
2026-06-19 20:01:47 +00:00
drh
7b386a77ff
Prototype implementation for a new sqlite3_result_str() API.
...
FossilOrigin-Name: cdbc62c36a37ad687589917c6f1e92ded6d99959c54eb8d79eaaef6fa57dacd3
2026-06-19 17:03:21 +00:00
drh
3a697a26de
Fix the format() SQL function so that it returns an empty string not a
...
NULL if the first argument is an empty string.
[bugs:/info/2026-06-19T16:40:04Z|Bug 2026-06-19T16:40:04Z]
FossilOrigin-Name: ece7af98a8bf982567b489cf82a52519f46a1c9360c82a486dbe1cd0664b1555
2026-06-19 16:55:08 +00:00
dan
593b55cb78
Fix a cast in fts3_write so that it is applied as intended. Bug [bugs:/info/2026-06-19T07:56:23Z | 2026-06-19T07:56:23Z].
...
FossilOrigin-Name: d6a3272e5592bcfeecf8a06dd8330cce57ff6603b24994b533d1fdcd48b5dc66
2026-06-19 11:46:05 +00:00
dan
8c4a4acc02
Fix an fts5 problem causing attempts to create locale=1 tables with more than 115 columns to fail. Bug [bugs:/info/2026-06-19T05:19:08Z | 2026-06-19T05:19:08Z].
...
FossilOrigin-Name: 979229f720e63d0294be14dae3f9fad68f76e4126a0ad63e32573cdfecd0151e
2026-06-19 11:14:16 +00:00
drh
978b0abe4d
Fix a memory size computation error on 32-bit platforms caused by
...
check-in [9a2a230464e43140].
FossilOrigin-Name: dc4763b14c421710f2a19c19c1cac455c1d0244b27303b6f328c778ac188bb02
2026-06-18 17:09:20 +00:00