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

878 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
c911dda3d3 Fix a potential UAF bug in the zipfile extension.
FossilOrigin-Name: 46fbc23c16b3d104605f5abe5d7a5e779021e264bde409f2d9939de9b5cb9b37
2026-06-03 13:16:20 +00:00
drh
f7915390d5 The prefix_length() function should stop at the first NUL terminator.
FossilOrigin-Name: b5f9dc646df5059e546ceb1404a62aadeff4a33163d9b3758e78a33ff3c23467
2026-06-03 11:30:01 +00:00
drh
42be6fdf22 Make the (unused, untested, and unsupported) ext/misc/compress.c routines
responsive to OOM conditions.

FossilOrigin-Name: 2d1dc1c6c679d920e4f5d79acefbf318183ef37bc65bc78dc50f8512f317c1f5
2026-06-03 11:05:22 +00:00
drh
81ceb00b00 Fix an integer overflow that could lead to a buffer overrun in the zipfile
extension.

FossilOrigin-Name: ae9c99b904a8d1b9745a8f09cb35412e4107f4f24f95cabccc18a777b9e76bdf
2026-06-01 13:44:19 +00:00
drh
8626a528e1 Extra defenses against integer overflows in the untested, unused, and
unsupported transliterate() SQL extension function found in the
ext/misc/spellfix.c extension.

FossilOrigin-Name: ca800b1d2d243715426045df0d40ad171aed89182f4a5bb1055787964e74ff3c
2026-06-01 13:39:15 +00:00
drh
b8c5fe2c19 Fix the zipfile extension so that ZIP archives containing files whose names
contain embedded \000 bytes do not cause problems.

FossilOrigin-Name: f6108e2fbdddfa03154a12efab17e5c1d681884ebcdfb6da5c319544601676ed
2026-05-31 15:52:29 +00:00
drh
fa5d2efbfc Remove the untested and undocumented "scrub" utility program. It was written
in 2016, but made obsolete by the VACUUM INTO command in 2019.

FossilOrigin-Name: 20c458172e0b09f7ada7f8cb8be95450c3988e620cbf6f174470bf8e78dcfbf0
2026-05-30 10:15:58 +00:00
drh
2b6b982a77 Limit the length of inputs to the spellfix1_editdist() extension
function (not part of the standard SQLite build and rarely used)
to 99999 characters, to avoid any possibility of integer overflow.

FossilOrigin-Name: e56ac902fa4f1219d3affbe3ac9f822406a58486e456f0200a5d0f47fa4e5b43
2026-05-21 13:39:43 +00:00
drh
62587d292b Limit the size of input strings to the (disused) spellfix extension
to avoid excessive runtime and integer overflows.

FossilOrigin-Name: 2a8951b548a9408df300d238a9fea313268a30c322f0efc0b233bdd3e71a7f9d
2026-05-19 10:33:53 +00:00
drh
4e2383b65b Fix a NULL pointer dereference in the obscure (and unused) prefixes
extension, which I had forgotten even existed.

FossilOrigin-Name: 24b8ecd17f70f222c40aa91382515a7d0d0b82c882498ae0714818d672806e7f
2026-05-19 10:30:29 +00:00
drh
0268517163 Fix a corner-case floating-point rounding problem in the generate_series()
virtual table.

FossilOrigin-Name: 931119281252ba73693770ac301010a84eb9c2b06247b17e3252271163341ab0
2026-05-09 12:08:59 +00:00
drh
34e139d3a3 Always use sqlite3_malloc64() in extensions, where possible.
FossilOrigin-Name: 6194f3b5314ef98b5d73060450de8e3497272494b47e6f96992453418894ded1
2026-04-01 16:56:48 +00:00
drh
f62cff6a9e Fix harmless compiler warnings in the csv.c.
FossilOrigin-Name: 6ac701f89e2ac8dfd18d041eb8c36a0c2b9fedc5618d3a95be794aecce5c59cf
2026-03-20 20:35:21 +00:00
drh
08eb5e9e51 Continue enforcing the legacy declaration-before-statement C-language rule,
since some downstream still uses it.

FossilOrigin-Name: 5c237f1f863a32cf229010d2024d0d1e76a07a4d8b9492b26503b959f1c32485
2026-03-18 22:31:56 +00:00
drh
169f68ed88 Improved defenses against mischief.
FossilOrigin-Name: 8bdc0d485e3ad0c7a1e818da66f106951d496b05cbe61d12c2c448f2f24b6d5d
2026-03-11 14:43:29 +00:00
drh
140cbff0d2 Remove an obsolete pragraph from the header comment on the fileio.c extension.
FossilOrigin-Name: 17613b72f34162ce22864621c519e883930c9f51a0a86afbf30ce664f95d7be1
2026-03-09 14:04:34 +00:00
drh
016a0ebedc Fix the completion.c TVF so that the xNext method reports errors it encounters
while running queries.

FossilOrigin-Name: eebcdcceef8a436e5fb1397cad6eb5bcf0722060fe1cd6acb26cdf1e86f07293
2026-03-08 19:31:40 +00:00
drh
456c7ea715 In the decimal.c extension, set a default MAX_DIGITS to 100 million.
Do not allow integer overflow of the N parameter to the internal
decimal_round() function.

FossilOrigin-Name: d0e23423d1bdd0482db4b74ef0fde2fbc2bbad02a7b92ba45a27ca57f4740e16
2026-03-08 18:50:35 +00:00
drh
b4f257f5e0 Fix another memory leak following OOM in the decimal extension.
FossilOrigin-Name: 414f6dbc09c2a3cf04ccdfd8f11eecb7ef781facff979ae4236a452913001391
2026-03-07 11:23:11 +00:00
drh
6142524b70 The optional SQLITE_DECIMAL_MAX_DIGIT compile-time option limits the
maximum number of digits that the decimal extension will operate on.

FossilOrigin-Name: 4214485b2fe4b95d9440008158d458b4b957a111f201965de1a518623589fd79
2026-03-07 02:36:39 +00:00
drh
3866d01907 Reenable the is_base85() extension function that was disabled
by [af18b68978ec9b1f].

FossilOrigin-Name: be07c16e3a7d28b95bea4b987a880d5b4b2b44d9a31ac5b48caa5b6c6dc5bec3
2026-03-07 00:14:36 +00:00
drh
02d9860c8e Fix another NULL ptr deref following OOM in the sha1 extension.
FossilOrigin-Name: c4843e4cce71acb1e3743c45e0ee8cf62e91c39b57cec4f356bf7a4a10f81352
2026-03-07 00:10:34 +00:00
drh
7f6236bed1 Fix a NULL pointer dereference following OOM in the sha1 extension.
FossilOrigin-Name: 530b3f97ca4e8b1d263266855743b0d57d048104a6c3bed6c4d7958985767bc6
2026-03-07 00:03:47 +00:00
drh
56b571780e Fix a NULL pointer dereference following OOM in the decimal extension.
FossilOrigin-Name: de37f30b2100e0c249e5c0853d6af90cd3c2069899747dcf0889e6a3d6b94061
2026-03-06 23:58:58 +00:00
drh
84334c941a Fix a memory leak following OOM in the completion extension.
FossilOrigin-Name: ff5b1efbf80875a82b3707b56440551eb6f68a899ade27363bc62872fe46fd75
2026-03-06 23:56:03 +00:00
drh
8f65da4574 Fix a memory leak in the decimal extension that follows an OOM.
FossilOrigin-Name: 8d59e47e7ae0aae01cb25c6c054cf9a4d9651e858bc0dd1a0e2a013ec6579012
2026-03-06 23:37:45 +00:00
drh
1bf79ca445 Rename the initializer functions for base64() and base85() to include the
number at the end.

FossilOrigin-Name: af18b68978ec9b1ff732505bfb92bb65e4f7381b904123f42c638b747569fa28
2026-03-06 22:09:39 +00:00
drh
7c483444a1 Fix a NULL pointer dereference in the (undocumented) two-argument version
of the decimal() extension SQL function.
[forum:/forumpost/fa9c2dc83f|Forum post fa9c2dc83f].

FossilOrigin-Name: a0266351df8700383d50c2ef2d179dd82b0e0fd7fc70d05a91d5e4e845983b46
2026-03-06 21:31:07 +00:00
drh
7fa89ea907 Change some sqlite3_realloc() calls into sqlite3_realloc64().
FossilOrigin-Name: a391f5646926787fd9a004225ea406b61d20f282c852c0282fd26cada644b601
2026-03-02 15:06:59 +00:00
dan
33478099c9 Fix a possible 9-byte buffer overread in the zipfile extension hit when processing a corrupt zip file. Forum post [forum:/forumpost/721a05d2c5 | 721a05d2c5].
FossilOrigin-Name: 5db21813d126554d80db903be6d36ab6c1f73f9135a54af6dcfcfce0bcc18e68
2026-03-02 11:22:28 +00:00
drh
9235f9b049 Enhance the realpath() SQL function in the fileio.c extension
so that it works ever for pathnames that do not exist.

FossilOrigin-Name: 27a5735fb1e194d763ab9fdb933fad4f694fb2f8ad19205d17ac81caebd82548
2026-02-23 11:44:30 +00:00
drh
95fe5b9c38 Improved implementation of realpath() in the fileio.c extension that does not require
the last element of the path to actually exist.

FossilOrigin-Name: 4df4999484d9008d8af3c9c340810e0cf5f57161ba053ed5501276b450577039
2026-02-23 00:57:00 +00:00
drh
9bc017423c Add the realpath() SQL function to the fileio.c extension. And clean up
the UTF8 handling on the Windows side of that extension while we are at it.

FossilOrigin-Name: 8bb8941930378b436f1353603be194644568b55fe347475be0caddddad40efa3
2026-02-22 20:44:52 +00:00
drh
f8681fb638 Fix a harmless warning in the decimal extension.
FossilOrigin-Name: f16c7c4000f2b992f7245dcaf669f13ed464579f8894f3c16842eebf41285c70
2026-02-21 20:20:06 +00:00
drh
62546d4b1f In the decimal extension, an optional second argument to the
decimal() and decimal_exp() functions rounds the value to the
number of significant digits specified by that argument.

FossilOrigin-Name: cb24edf1afc3f9083a4963c5fe232933eccc7c0cb8872aa5fcd336d226b885ef
2026-02-20 16:21:58 +00:00
drh
d447df4205 Add new functions ieee754_to_int() and ieee754_from_int() to the
ieee754 extension.  No changes to the core SQLite.

FossilOrigin-Name: 8660d3e94cbe892693554df282bce0fa8c7aedbc5e020cab647cbbff3d7e55b7
2026-02-20 14:20:33 +00:00
drh
7549e784a8 Minor fixes to tmstmpvfs.c.
FossilOrigin-Name: 091bd90ed5a6a326fd532e93bd17903e052476da14dc6aee2599a9acf75a3276
2026-02-17 14:28:18 +00:00