From: stephan Date: Tue, 21 Jul 2026 16:43:36 +0000 (+0000) Subject: Document the origin of the input size limit for #base64. No functional changes. X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=add85ddbb3a8cab19e998abc2572ee878a8df21c;p=thirdparty%2Fsqlite.git Document the origin of the input size limit for #base64. No functional changes. FossilOrigin-Name: 696988aac30797139060eb2718fcfda0363f1fa73df1187ea56956681d577411 --- diff --git a/ext/wasm/libcmpp.c b/ext/wasm/libcmpp.c index 65a3b14ef0..543e544c1e 100644 --- a/ext/wasm/libcmpp.c +++ b/ext/wasm/libcmpp.c @@ -10361,13 +10361,19 @@ int cmpp__b_base64_encode(cmpp *pp, cmpp_b const * bIn, cmpp_b * bOut){ cmpp_size_t nc; cmpp_size_t const nv = bIn->n; char *cBuf; - cmpp_size_t const nvMax = 1024 * 1024 * 1024; + cmpp_size_t const nvMax = 1000 * 1000 * 1000 + /* 1B == default SQLITE_MAX_LENGTH, but that symbol is not exposed + in its public API. We "could" extract that limit from pp's db + here, but... nah. We're only using it as a guideline, it's not + part of the db state so we're not beholden to its limits. In + this context the limit is arbitrary, anyway - we inherit it + from this code's origins and retain it for simplicity. */; if( ppCode ) return ppCode; nc = 4*((nv+2)/3); /* quads needed */ nc += (nc+(B64_DARK_MAX-1))/B64_DARK_MAX + 1; /* LFs and a 0-terminator */ if( nvMax < nc ){ return cmpp_err_set(pp, CMPP_RC_RANGE, - "Blob expanded to base64 too big."); + "Blob expanded to base64 is too big."); } cmpp_b_reuse(bOut); if( !bIn->z || !bIn->n ){ diff --git a/manifest b/manifest index a7d05b8c7f..dc3835324b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Simplify\sthe\sprevious\scheckin\sby\sremoving\san\sextraneous\slocal\svar. -D 2026-07-21T16:29:34.759 +C Document\sthe\sorigin\sof\sthe\sinput\ssize\slimit\sfor\s#base64.\sNo\sfunctional\schanges. +D 2026-07-21T16:43:36.172 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -636,7 +636,7 @@ F ext/wasm/index-dist.html db23748044e286773f2768eec287669501703b5d5f72755e8db73 F ext/wasm/index.html 5bf6cf1b0a3c8b9f5f54d77f2219d7ae87a15162055ce308109c49b1dcab4239 F ext/wasm/jaccwabyt/jaccwabyt.js 4e2b797dc170851c9c530c3567679f4aa509eec0fab73b466d945b00b356574b F ext/wasm/jaccwabyt/jaccwabyt.md 6aa90fa1a973d0ad10d077088bea163b241d8470c75eafdef87620a1de1dea41 -F ext/wasm/libcmpp.c 279a24d417036b875766382df16a8270a189a3d2f50fe96bb30d50b96ec4eab9 +F ext/wasm/libcmpp.c d8f0ebc08f7f9ac7c6b222481fc545613668440b78fa726a95ac99b61893ecfa F ext/wasm/mkdist.sh f8883b077a2ca47cf92e6f0ce305fbf72ca648c3501810125056c4b09c2d5554 x F ext/wasm/mkwasmbuilds.c afaba6a5b79ff6adeb13cea26b62722828593e8cdbed55cf5563c61b2d94780c F ext/wasm/module-symbols.html e54f42112e0aac2a31f850ab33e7f2630a2ea4f63496f484a12469a2501e07e2 @@ -2217,8 +2217,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P 999d20197143d884158341ac36e33bc1eb8e3484228eaf532818add927c30228 -R 01b5f39830ce468bc55b6b4b65d68bfb +P 6382d8336e2891c556456a340daecff81766980a27071e1d5bda6262ffba6f26 +R 9b101ed22e16de099d1646505ada9788 U stephan -Z 2ccf2777857953581b5e7f6aa99d5387 +Z 5151a5e97a1ae1e162ef6e11c715e3e9 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 1cc5a2ddac..8bdd091b8d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6382d8336e2891c556456a340daecff81766980a27071e1d5bda6262ffba6f26 +696988aac30797139060eb2718fcfda0363f1fa73df1187ea56956681d577411