From: drh <> Date: Mon, 20 Mar 2023 00:48:40 +0000 (+0000) Subject: When reporting errors in the CLI, ignore the output of sqlite3_error_offset() X-Git-Tag: version-3.42.0~244 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0d53e8ed543e9501026b895b8a02a7822d333b99;p=thirdparty%2Fsqlite.git When reporting errors in the CLI, ignore the output of sqlite3_error_offset() if the value returned is clearly out-of-range. One of two lines of defense against [33aa4c0de8a62e33]. FossilOrigin-Name: 26adbb80f51b9219ab2a3593496458b74a567ba5ee46b5154f056e389cfc09f7 --- diff --git a/manifest b/manifest index 138c8790b9..05483f4ab4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Increase\sthe\ssize\sof\sref-count\svalues\sin\sthe\spager\slayer\sto\s64-bits,\sto\savoid\nany\sreasonable\spossiblity\sof\soverflowing\sthe\scounters.\nThere\sis\sa\sperformance\sand\smemory\spenality\sfor\sthis.\n[forum:/forumpost/b741f15a35|Forum\spost\sb741f15a35]. -D 2023-03-19T21:48:55.585 +C When\sreporting\serrors\sin\sthe\sCLI,\signore\sthe\soutput\sof\ssqlite3_error_offset()\nif\sthe\svalue\sreturned\sis\sclearly\sout-of-range.\s\sOne\sof\stwo\slines\sof\sdefense\nagainst\s[33aa4c0de8a62e33]. +D 2023-03-20T00:48:40.933 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -626,7 +626,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 6a0253379cc15b3f80321362a61f487a8ef7cd2487fe62e1eb2317b3f871c61f F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92 F src/select.c 64a4b48a14f5d19a5ddc4afde37a435aebb92113f52653f8fe9e69fc3e9ff9aa -F src/shell.c.in 55c54f1a48d7c78a0fca98a685ec6809b0ce8782169d441d7dd2c891dc07cfc3 +F src/shell.c.in b47c3489777c6bb7b30c049bef3ef925528c19fbb53d980d772d0b8e8841db8f F src/sqlite.h.in f01033703156615566bb329144d736a37fc35a278049db91127782a9c799b938 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h da473ce2b3d0ae407a6300c4a164589b9a6bfdbec9462688a8593ff16f3bb6e4 @@ -2051,8 +2051,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 02ac2297abee6af64c8df230b42b07f21cff4565d7e315860b2396a7c0c556ca -R 786303851e34199f284746d4fa5c1e0a +P 6c5d99a813e8498c2ea91383ac8886a43eaf47023919c03900e893640c03778d +R 9c89c66108b961928ba91967c3305114 U drh -Z 90a20a841f2fa0f322839e6c9c925028 +Z 117402f7ae1dac33496e02b8aa6ae706 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index a0d05a322e..13bd45e197 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6c5d99a813e8498c2ea91383ac8886a43eaf47023919c03900e893640c03778d \ No newline at end of file +26adbb80f51b9219ab2a3593496458b74a567ba5ee46b5154f056e389cfc09f7 \ No newline at end of file diff --git a/src/shell.c.in b/src/shell.c.in index 1f49a50565..8e2ad1cb23 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -2774,6 +2774,7 @@ static char *shell_error_context(const char *zSql, sqlite3 *db){ if( db==0 || zSql==0 || (iOffset = sqlite3_error_offset(db))<0 + || iOffset>=strlen(zSql) ){ return sqlite3_mprintf(""); }