From: drh <> Date: Tue, 8 Mar 2022 16:12:53 +0000 (+0000) Subject: Fix a potentially uninitialized local variable in the ".import" X-Git-Tag: version-3.38.1~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b7520b747bc6eccf559e08babd863fc54aac260;p=thirdparty%2Fsqlite.git Fix a potentially uninitialized local variable in the ".import" command of the CLI - introduced by [741651fd4b1b776b]. This same change is part of the nearby [/info/5e30c6ea707f9d38|"Fix compiler warnings"] check-in. FossilOrigin-Name: ce9e3d903c2e5993a3fdadaf809ce2026efd1b5b933930b50dd794c9a7329cdd --- diff --git a/manifest b/manifest index 6257c1f4ac..fed6f3e1bd 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Disable\san\sassert\sin\smoveToRoot()\swhen\sthe\sdatabase\sis\scorrupt.\n[forum:/forumpost/e9a176b7bd|Forum\spost\se9a176b7bd]. -D 2022-03-07T18:38:12.833 +C Fix\sa\spotentially\suninitialized\slocal\svariable\sin\sthe\s".import"\ncommand\sof\sthe\sCLI\s-\sintroduced\sby\s[741651fd4b1b776b].\s\sThis\ssame\schange\nis\spart\sof\sthe\snearby\s[/info/5e30c6ea707f9d38|"Fix\scompiler\swarnings"]\ncheck-in. +D 2022-03-08T16:12:53.276 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -553,7 +553,7 @@ F src/random.c 097dc8b31b8fba5a9aca1697aeb9fd82078ec91be734c16bffda620ced7ab83c F src/resolve.c ea935b87d6fb36c78b70cdc7b28561dc8f33f2ef37048389549c7b5ef9b0ba5e F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92 F src/select.c 3baa9dd8cf240654773c7974e2bcce398ac9dd24419c36684156963defe43b35 -F src/shell.c.in 0a9c4b9226143365c8aea42eb9a62e055e9fffffc5e4559da5c9dadc0bedaa25 +F src/shell.c.in 69d1e59da4881f096ab47fbd3e6d99794f3e4a43f41fd9e4d2e845c9b8d20fd5 F src/sqlite.h.in e82ac380b307659d0892f502b742f825504e78729f4edaadce946003b9c00816 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h a95cb9ed106e3d39e2118e4dcc15a14faec3fa50d0093425083d340d9dfd96e6 @@ -1944,9 +1944,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 369d240455a2806afb1699273864bca3f84b163c6b1f93807c9147437001132b -Q +ae464a18d74bf44fc95bc335e75e6a57dc974f6d6a3d603133594039fb589af2 -R 65faebfa79f550630f53a6da2715c5c9 +P ab744a5da80ddcd5c7cce60626d82c0e368f675b8a11bfb93b4739ea30bb07c0 +R a3a1f81f5ee81baa9f34242a6c335b2e U drh -Z ea2b412845d41d61e2f316cd94b3e1bb +Z d441488a9b712e18c47317a933ef0a68 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 573c2c9af7..f6715531a3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ab744a5da80ddcd5c7cce60626d82c0e368f675b8a11bfb93b4739ea30bb07c0 \ No newline at end of file +ce9e3d903c2e5993a3fdadaf809ce2026efd1b5b933930b50dd794c9a7329cdd \ No newline at end of file diff --git a/src/shell.c.in b/src/shell.c.in index b0f3b02dc4..45cbb436e0 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -8842,6 +8842,7 @@ static int do_meta_command(char *zLine, ShellState *p){ int eVerbose = 0; /* Larger for more console output */ int nSkip = 0; /* Initial lines to skip */ int useOutputMode = 1; /* Use output mode to determine separators */ + char *zCreate = 0; /* CREATE TABLE statement text */ failIfSafeMode(p, "cannot run .import in safe mode"); memset(&sCtx, 0, sizeof(sCtx)); @@ -8993,10 +8994,10 @@ static int do_meta_command(char *zLine, ShellState *p){ rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */ if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(p->db))==0 ){ - char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zFullTabName); sqlite3 *dbCols = 0; char *zRenames = 0; char *zColDefs; + zCreate = sqlite3_mprintf("CREATE TABLE %s", zFullTabName); while( xRead(&sCtx) ){ zAutoColumn(sCtx.z, &dbCols, 0); if( sCtx.cTerm!=sCtx.cColSep ) break;