From 5705b41fb80137aa0e63cbfaddf6ce63e7ea6d4d Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 24 Mar 2022 14:01:55 +0000 Subject: [PATCH] The "PRAGMA writable_schema=ON" flag should not allow OOM errors to pass while parsing the schema. dbsqlfuzz 9cc49e1a53e1cef8e3a1496a88c683aa20483163. FossilOrigin-Name: a7abb725c7c783331e73837597917e25e5ff692aac8ec97a0a8c0e30db62d68b --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/prepare.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 48ebdf8a82..5606959056 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Use\strickery\sto\scode\sthe\sUTF-8\sBOM\sfor\sthe\s--bom\soption\son\s.output,\s.once,\nand\s.excel\sin\sthe\sCLI,\sto\swork\saround\sa\swarning\sin\ssome\sMicrosoft\scompilers.\n[https://fossil-scm.org/forum/forumpost/bd0844268f0fab71|Fossil\sforum\spost\sbd0844268f0fab71]. -D 2022-03-23T10:04:52.573 +C The\s"PRAGMA\swritable_schema=ON"\sflag\sshould\snot\sallow\sOOM\serrors\sto\spass\nwhile\sparsing\sthe\sschema.\ndbsqlfuzz\s9cc49e1a53e1cef8e3a1496a88c683aa20483163. +D 2022-03-24T14:01:55.718 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -547,7 +547,7 @@ F src/pcache.h 4f87acd914cef5016fae3030343540d75f5b85a1877eed1a2a19b9f284248586 F src/pcache1.c 54881292a9a5db202b2c0ac541c5e3ef9a5e8c4f1c1383adb2601d5499a60e65 F src/pragma.c 9047ffb003d9434810ee81d7b1722d0093821622eb3217c962c3407bad949ce2 F src/pragma.h e690a356c18e98414d2e870ea791c1be1545a714ba623719deb63f7f226d8bb7 -F src/prepare.c a187dade741c1f09ae118fcbbf0302511807bfc0355880927d7152eb75b8260d +F src/prepare.c fd940149c691684e7c1073c3787a7170e44852b02d1275d2e30a5b58e89cfcaf F src/printf.c 05d8dfd2018bc4fc3ddb8b37eb97ccef7abf985643fa1caebdcf2916ca90fa32 F src/random.c 097dc8b31b8fba5a9aca1697aeb9fd82078ec91be734c16bffda620ced7ab83c F src/resolve.c ea935b87d6fb36c78b70cdc7b28561dc8f33f2ef37048389549c7b5ef9b0ba5e @@ -1945,8 +1945,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 a85126f96614c53b030c6e6c43ff239eae458048597a10e9a0361fcec8628ecf -R c0d21f3a897da32dc231cb9a9071f457 +P 43143ad131f17734fd2eff849e0a1bc2e26daf6a28c7e07d697d38732e6af5fc +R c6ecdf0c09fcfac1e33c997c57a43f56 U drh -Z 59c54a229953561c06d50ca7a8ed1998 +Z 9ff38d7c1e3943096d040996e86f8218 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d9afa6af5b..515843110e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -43143ad131f17734fd2eff849e0a1bc2e26daf6a28c7e07d697d38732e6af5fc \ No newline at end of file +a7abb725c7c783331e73837597917e25e5ff692aac8ec97a0a8c0e30db62d68b \ No newline at end of file diff --git a/src/prepare.c b/src/prepare.c index 7e08a5a674..d402da4a3a 100644 --- a/src/prepare.c +++ b/src/prepare.c @@ -389,7 +389,7 @@ int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFlags){ sqlite3ResetAllSchemasOfConnection(db); pDb = &db->aDb[iDb]; }else - if( rc==SQLITE_OK || (db->flags&SQLITE_NoSchemaError)){ + if( rc==SQLITE_OK || ((db->flags&SQLITE_NoSchemaError) && rc!=SQLITE_NOMEM)){ /* Hack: If the SQLITE_NoSchemaError flag is set, then consider ** the schema loaded, even if errors (other than OOM) occurred. In ** this situation the current sqlite3_prepare() operation will fail,