From: drh <> Date: Thu, 4 Jun 2026 11:18:11 +0000 (+0000) Subject: Clearly mark the ext/misc/wholenumber.c extension as "testing and X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=95d072cc8136ddeb4962c3add943cc7d3abe00fc;p=thirdparty%2Fsqlite.git Clearly mark the ext/misc/wholenumber.c extension as "testing and debugging use only". Fix a potential integer overflow that can occur if the above warning is ignored. [bugs:/info/2026-06-04T09:40:28Z|Bug 2026-06-04T09:40:28Z]. FossilOrigin-Name: 44154ea9ae99d532d5c7268d70bd8b32751f7a82c367c7bd1ec0e6948d71d1b8 --- diff --git a/ext/misc/wholenumber.c b/ext/misc/wholenumber.c index fe5fc83ab0..160ae0eb9a 100644 --- a/ext/misc/wholenumber.c +++ b/ext/misc/wholenumber.c @@ -13,6 +13,11 @@ ** This file implements a virtual table that returns the whole numbers ** between 1 and 4294967295, inclusive. ** +** TESTING AND DEBUG USE ONLY -> This is not production code. This is +** not a deliverable. Use the generate_series() virtual table for +** real-world applications instead of this extension. THIS EXTENSION +** MAY CONTAIN BUGS. +** ** Example: ** ** CREATE VIRTUAL TABLE nums USING wholenumber; @@ -154,12 +159,14 @@ static int wholenumberFilter( pCur->iValue = 1; pCur->mxValue = 0xffffffff; /* 4294967295 */ if( idxNum & 3 ){ - v = sqlite3_value_int64(argv[0]) + (idxNum&1); + v = sqlite3_value_int64(argv[0]); + if( v<=pCur->mxValue && (idxNum&1)!=0 ) v++; if( v>pCur->iValue && v<=pCur->mxValue ) pCur->iValue = v; i++; } if( idxNum & 12 ){ - v = sqlite3_value_int64(argv[i]) - ((idxNum>>2)&1); + v = sqlite3_value_int64(argv[i]); + if( v>0 && ((idxNum>>2)&1)!=0 ) v--; if( v>=pCur->iValue && vmxValue ) pCur->mxValue = v; } return SQLITE_OK; diff --git a/manifest b/manifest index 807cde9311..9c56e44781 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sthe\sutf-8\sdecoder\sin\sthe\sICU\sextension\sto\streat\sinvalid\ssequences\sas\scodepoint\s0xFFFD,\smatching\sthe\score.\sReport\s[bugs:/info/2026-06-03T04:04:46Z\s|\s2026-06-03T04:04:46Z]. -D 2026-06-03T17:21:12.153 +C Clearly\smark\sthe\sext/misc/wholenumber.c\sextension\sas\s"testing\sand\ndebugging\suse\sonly".\s\sFix\sa\spotential\sinteger\soverflow\sthat\scan\soccur\nif\sthe\sabove\swarning\sis\signored.\n[bugs:/info/2026-06-04T09:40:28Z|Bug\s2026-06-04T09:40:28Z]. +D 2026-06-04T11:18:11.467 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -417,7 +417,7 @@ F ext/misc/vfsstat.c 2b21efa93062ce814fbe28e6dff2acfafa4073a14b8d02cacfb4da1d604 F ext/misc/vfstrace.c fc8c393a8316a8c20867b7e6e92908c4f81060c9e1f24d6ad9aefdc91c01dd13 F ext/misc/vtablog.c 6c0c11c4822ab6c1a205718ea7c6d1bb561d96b27104b9c1fe84d01aa62d6c9c F ext/misc/vtshim.c f5ab480d1e33fa46a0b138359bedc9979e32798d72348e04bbe6093f9ae95c7b -F ext/misc/wholenumber.c aa5e6d786fe8d79bc100ea0e852249c026a91ae65a5c1bcb2b869cd1a7cdd6d5 +F ext/misc/wholenumber.c e41953e078894e66a0ff05dd6c76a61f904828c9a4620c7255fac26754f30d3a F ext/misc/windirent.h 02211ce51f3034c675f2dbf4d228194d51b3ee05734678bad5106fff6292e60c F ext/misc/zipfile.c 58d535e6f177709c3f3607e19aa8e1b4c3c57c1f2c78bd4cdfac15e0b2f53e5a F ext/misc/zorder.c bddff2e1b9661a90c95c2a9a9c7ecd8908afab5763256294dd12d609d4664eee @@ -2207,8 +2207,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P e7335dd377a73fc2b913076ee659ed2b0c4a131b16e04b1b55fae677d6b56e8a -R 76459793b542cac7a653cb0d492caf87 -U dan -Z c5b37e6b8e1169453987f78b56c34770 +P 840be0ee62c0ba34f4916c382e2d07071bebd8ce7bca31deb1616869722bfa4d +R 2492b2afdbc61c25eaa3d54298fe9baa +U drh +Z 15461e36c37555c1359586ce59b62b6c # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index ecfcd1e0bd..bc273f1311 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -840be0ee62c0ba34f4916c382e2d07071bebd8ce7bca31deb1616869722bfa4d +44154ea9ae99d532d5c7268d70bd8b32751f7a82c367c7bd1ec0e6948d71d1b8