Commit Graph

822 Commits

Author SHA1 Message Date
drh
35b9709d46 Fix integer overflow problems and error reporting memory leaks in
the zipfile extension.
[forum:/forumpost/2026-01-13T00:09:06Z|Forum post 2026-01-13T00:09:06Z].

FossilOrigin-Name: 8e656a483557bc5385219d560b9155c232e7dc9d62642249abc879fb37bacd2a
2026-01-13 02:35:19 +00:00
drh
9a341c1edb Avoid unsigned integer overflow in the delta_apply() extension function.
Not part of any standard deliverable.  
[forum:/forumpost/d41879b367c7f7ec|Forum thread d41879b367c7f7ec].

FossilOrigin-Name: b354dd12c25c820c04b08e0be4ba8c095fc648dfb4b71345aacce50a17fd269a
2026-01-12 19:56:00 +00:00
drh
6444f694a6 Improved documentation (in the header comment) for tmstmpvfs.c.
FossilOrigin-Name: 70b1da718c176b8eb154fe087af4352eb6f55c9c0d1f09fc625d073d9f8075f4
2026-01-12 14:45:55 +00:00
drh
c34d561940 Change the name of the log file for tmstmpvfs.c to be an ISO8601 date/time,
for improved readability and situational awareness.

FossilOrigin-Name: 66018b85a92db2f3b6b15f7c5c0d54bac890f8e50a1839c08857507c39ec4af7
2026-01-08 18:55:49 +00:00
drh
5df3efe6f4 Fix an off-by-one error in the page number of ELOG_CKPT_PAGE log
messages in tmstmpvfs.c

FossilOrigin-Name: 6fafd010de2d9820f77ee6d2a5f0a7ab1260872d09e95b6932c959ef017aaa77
2026-01-08 17:52:42 +00:00
drh
403c153dfa Minor bug fixes in tmstmpvfs.c, showdb.c, and showtmlog.c.
FossilOrigin-Name: 1fee8265f7eab649ee8b28456c37d95198f5cde54e905154e3eccc0b328ece9a
2026-01-08 15:25:04 +00:00
drh
c0420cd8e4 Add the showtmlog utility for decoding the tmstmpvfs log files.
Fix tmstmpvfs so that it records timestamps in milliseconds since the
Unix epoch, not in JDN milliseconds.

FossilOrigin-Name: 762d3cbf06218f1010425a98a71ebf7623b84b45a90e6419b7dec7f10ad0c5a5
2026-01-08 12:22:50 +00:00
drh
8a2be4b739 Add the tmstmpvfs.c extension to trunk. It is not a part of any deliverable
and can easily be removed later, if found to not be desirable.

FossilOrigin-Name: 869f306592a86d2a78f00266c615f033cd2318a7bff0a97b3dcdd3348d99fc66
2026-01-08 00:41:12 +00:00
drh
ef5d9952eb Fix the static build.
FossilOrigin-Name: 4e1a1b6aeffaa5b8c11e165803c6d33becabd1f646f39e4309dfba6892fd4bd6
2026-01-07 19:06:11 +00:00
drh
0b5f8766fd Improvements to logging. Better log-file names. Log files are in a
subdirectory named after the database.  Only connections that write to
the database create logs.  Better documentation in the header comment.

FossilOrigin-Name: 5b1cf0fe73ba1a40fe4cd8f5f6e8ee5b471f96b60aff52c03c045ad6514c363a
2026-01-07 18:45:23 +00:00
drh
8fe0385661 Documentation tweaks.
FossilOrigin-Name: b10b0aa7658a04b9354ca09a2dcb807eecd9421451537f3230ba5f47269ec5c1
2026-01-06 21:18:42 +00:00
drh
d3c9cce43c Enhance the timestamp-vfs prototype so that it also keeps an event log.
FossilOrigin-Name: f087c6c0cdd542ec24b4668fff9cb434f46caf554f8856a49fd062ab3f72014e
2026-01-06 20:51:06 +00:00
dan
55f258bd27 Update the regexp extension so that the "-" character may be escaped with a backslash. Forum post [forum:c5e7358f82 | c5e7358f82].
FossilOrigin-Name: 80013129361fb81ce5db1f6390cad640c2cb547e5ba16724dfb55d0aceecdf6d
2026-01-05 18:29:07 +00:00
drh
bb4428e605 Add the experimental tmstmpvfs.c extension that adds a timestamp and other
debugging information on each page of a database as that page is written,
if the database is configured for exactly 16 bytes of reserve space.

FossilOrigin-Name: 703e593dfc92676a2d44c67ca8282a78a1943b9c1e3f2447c0a9917d70a383c4
2026-01-05 17:28:33 +00:00
drh
02e38b4d21 In the (completely unused, as far as I know) btreeinfo.c extension (not
a part of any standard build) do a better job of detecting corrupt database
files and provide better error messages when corruption is detected.
[forum:/forumpost/e66a458339|Forum post e66a458339].

FossilOrigin-Name: 326d29ac7ecd933d6fca80d3d538783ed46939e7bc6e3aa60ded4b619aa73730
2025-12-31 19:45:45 +00:00
drh
6789770822 Use 64-bit integers to track memory allocation sizes in the CSV extension.
[forum:/forumpost/e66a458339|Forum post e66a458339].

FossilOrigin-Name: f293a2b3ffcfe20fcda954bd31e88bbfcba18d007e9b5f29a473983f6030f2ce
2025-12-31 18:30:45 +00:00
drh
f8bd7df996 Use sqlite3_malloc64() in all places in the compress.c extension to avoid
integer overflow.
[forum:/forumpost/2025-12-31T01:04:00z|Forum post 2025-12-31T01:04:00z].

FossilOrigin-Name: 7ceaf1f0c3d9b96d2224ce6526fb3092b9e1673573e3d7dd898b2a135e23027d
2025-12-31 01:19:51 +00:00
drh
03380a55a5 Fix a typo in [0819fe670f9ceec7] that lead to incomplete protection against
buffer overflow in the zipfile extension.
[forum:/forumpost/2025-12-30T23:57:19z|Forum post 2025-12-30T23:57:19z]

FossilOrigin-Name: a6abbadacbb88c1ddcc236b40fb34eddf3bb0891189bd00a5af8d34b42871967
2025-12-31 01:01:14 +00:00
drh
3b81f93532 Fix a harmless signed integer overflow warning in the ieee754() extension
function.

FossilOrigin-Name: f43d3339c1f06aabcb8e678ed4b91a490cfd0bc880c642ce9c1138c7e08cb360
2025-12-22 12:00:57 +00:00
drh
28ec7be607 Stricter enforcement of the LIKE_PATTERN_LENGTH for the regexp extension.
FossilOrigin-Name: c94b1e9c5674f7d0ad75d91085262f38cba6036979e8a0f9d39edc7db841915f
2025-12-16 13:13:21 +00:00
drh
97601244e2 Enhance the vtablog extension so that it shows the value of
sqlite3_vtab_distinct() in xBestIndex, and so that provides the new
consume_order_by option that can cause xBestIndex to set the
orderByConsumed flag.

FossilOrigin-Name: b158fe929929ae209f2603b11a2c4f44ad9147f6b2ce09a10ec1f92429402631
2025-12-15 17:32:56 +00:00
drh
c2cd606f8a Prevent a malicious delta from causing an integer overflow in the
fossildelta extension.  This code is not used in the SQLite core.

FossilOrigin-Name: 01409738afc2c0d5bdaa248ffb508aa5f36a66390f6b8e4834734529ee8ed2fa
2025-12-11 23:24:05 +00:00
stephan
91479c6b10 Introducing kvvfs v2 for the JS bindings. Summary: no longer hard-coded to session/localStorage, available outside of the main UI thread (non-persistently), a simpler-to-use import/export API, and adds an asynchronous event interface intended for creating page-by-page db backups.
FossilOrigin-Name: ec866b04d088e53b09764d00f5403902785328fd8f3cbf80d3affa166477711d
2025-12-08 13:06:27 +00:00
stephan
50ef2f7813 Replace some double-quotes with single quotes an SQL doc snippet in the csv example virtual table.
FossilOrigin-Name: 1781e5e8d0cd2b508f7992987257416bd48841ea7e30bc9294784a7c1a402be7
2025-12-08 12:24:23 +00:00
drh
5a05c59d4d In the zipfile extension, only return as many bytes as Inflate actually
generated.  [forum:/forumpost/761eac3c82|Forum post 761eac3c82].
Adjust ./configure so that it builds zipfile into testfixture if ZLIB
is available, so that tests get run on unix platforms.

FossilOrigin-Name: 3d459f1fb1bd1b5e723629c463ab392af7b206ece3388bda216c6a4c26160909
2025-12-06 20:41:24 +00:00
drh
4a33eed6e9 Remove #ifdefs intended to make SQLite compatible with Windows RT. WinRT
was short-lived and has been discontinued for a long time.

FossilOrigin-Name: 108691a3cb2f296f0ede06c34271ee185f299bfd76e97a1bd06c730a28d94ff4
2025-12-06 19:56:40 +00:00
dan
1af2607177 Fix a memory leak in the fileio extension on windows.
FossilOrigin-Name: 19e5ae6e20a1e2f41c5bc77b7bb99211b22d6fabf21e5f2f7f82028615eb791e
2025-12-05 19:23:20 +00:00
drh
2087fa2d97 Make the shell_exec() routine in the CLI robust against NULL SQL text.
Fix harmless compiler warnings in ext/misc/zipfile.c.

FossilOrigin-Name: 2ecba7dfd10c7d6a7a34b0ec01a387c9f1426c0504c8f20edc03e29bb9aa93c3
2025-12-04 20:22:36 +00:00
drh
ecd330f59d Fix the sha1() extension function so that it returns actual TEXT instead
of a BLOB containing the UTF-8 TEXT.
[forum:/forumpost/d15eefea7c|Forum post d15eefea7c]

FossilOrigin-Name: 6f806656a3f5ce9a79b18be057d880faca506f66cd4de4b5d77393c266cfb6d2
2025-11-26 11:19:11 +00:00
drh
7f947dbd6c Move the ".output" command into a separate subroutine. Enhance .output so
that it is able to capture output in a sqlite3_str object, then compare that
captured output we patterns to accomplish tests.

FossilOrigin-Name: ddd167044753f5215624fc9ee0e3657836c528f23a6a3e262401fd1b64cdbb21
2025-11-11 14:08:50 +00:00
drh
29bdac3ee5 Remove stale code from the fileio.c extension.
FossilOrigin-Name: d26f115760f16cac1cd28c950d1c0eec199461d2c9a52baafb91ff6b8d5ec151
2025-11-04 23:47:49 +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
dan
8ce786f173 Fix sanitizer complaints in the regexp extension.
FossilOrigin-Name: 6ff9ecb89d769bc2a27f8a57130f28ec7478979d3e35ba765c16017b5bdf775d
2025-10-27 11:20:47 +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
abe709be8d Extra defenses against integer overflow in the decimal extension.
FossilOrigin-Name: 1a7414d9b5be7ce18b23c357fd98cd0e96d78ac626abfa6e4e0dee494b6a1efc
2025-10-14 14:03:09 +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
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
dan
9b6bc61dbd Fix some integer overflow warnings in the base64 and base85 extensions.
FossilOrigin-Name: 06b4bd2aba22c57f5a5fed606c3bee225dee6fdc13bb16cc58194040ef0d7d85
2025-10-07 15:14:03 +00:00
drh
1d574d3d71 Remove the memvfs.c extension, to prevent it from being misused.
See [forum:/forumpost/91811439aa|forum post 91811439aa] for the complaint
that prompted me to take down this demonstration code.  I have other things
to do rather than argue about posts such as the foregoing, so it is easier
to just take the code down.  If you need this code, you can downloading older
check-ins.  The beauty of DAG-based version control systems like Fossil
(and Git) is that nothing is ever lost; it is just stops appearing on
trunk.

FossilOrigin-Name: eb79110dcac80dde3bcca0929d67a8f8f6d2eea5695184b2b7c6788283f06902
2025-10-02 22:48:08 +00:00
drh
e2ebc364cd Fix typo in the previous check-in. Remove surplus end-of-line whitespace
from the ext/misc/fossildelta.c extension.

FossilOrigin-Name: cc87551805dc1fcb05598339e526b304401b64a4eaaa2148a9d837b1423484ce
2025-10-02 19:35:58 +00:00
drh
0d9ec8b2ee Harden the debugging vtab "delta_parse()" which is part of the
ext/misc/fossildelta.c extension against malicious inputs.
[forum:/forumpost/be139437c3|forum post be139437c3].

FossilOrigin-Name: 4be6deee646f2c0f591ba81f902182ca9302050a7fb2729c7f64981307058b8b
2025-10-02 19:19:40 +00:00
dan
cbc3cd47f0 Fix a buffer overrun in the zipfile extension that could occur while processing zip archives with extremely long file-names and comment fields.
FossilOrigin-Name: c284fda848038a61972fd1df5796f608a24ead109170aafe562a5d5787c46488
2025-10-02 11:16:22 +00:00
drh
65ee59bb26 Prevent embedded 0x00 characters in the output strings from confusing
the completion extension and causing it to read past the end of an array.
[forum:/forumpost/88a08b3201|Forum post 88a08b3201].

FossilOrigin-Name: 26f6d41f9d3ab656129af333d54a8645c6890314919bcae90351ba0c2240ceef
2025-10-01 19:01:19 +00:00
dan
a9af4102f1 Fix a buffer overread in demo code in ext/misc/memvfs.c.
FossilOrigin-Name: 90f7318308ca8372cbd9f183d88ff6cb884446f6df0695294c9a9955c5109f72
2025-10-01 14:28:48 +00:00
drh
0f76b0a4d6 Fix various compiler warnings.
FossilOrigin-Name: 24ee6c25b4745c8fd671d845b48b9ab98a787ccb348d560ad70f19d035e7990e
2025-09-30 17:37:18 +00:00