From: drh Date: Sat, 30 Nov 2013 12:49:28 +0000 (+0000) Subject: Detect a corrupt UnpackedRecord and return SQLITE_CORRUPT prior to calling X-Git-Tag: version-3.8.2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=094b7587fcade1fc3d33216c410a3d0ba7e0c2f4;p=thirdparty%2Fsqlite.git Detect a corrupt UnpackedRecord and return SQLITE_CORRUPT prior to calling sqlite3BtreeMovetoUnpacked(). FossilOrigin-Name: 55ec474db8935ef36fae30da5d11f5701c60c088 --- diff --git a/manifest b/manifest index 8b8ce60236..940dfe0022 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Change\sthe\sname\sof\sthe\sCORRUPTIBLE\smacro\sto\sCORRUPT_DB. -D 2013-11-29T15:39:36.814 +C Detect\sa\scorrupt\sUnpackedRecord\sand\sreturn\sSQLITE_CORRUPT\sprior\sto\scalling\nsqlite3BtreeMovetoUnpacked(). +D 2013-11-30T12:49:28.537 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in e1a9b4258bbde53f5636f4e238c65b7e11459e2b F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -166,7 +166,7 @@ F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34 F src/backup.c 1809a7caa2504233bdddd12f5018422421789537 F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7 -F src/btree.c ec8a4dcac5c1ec1ba9705b8c5a13e62167958317 +F src/btree.c fe6c95c57fd14ed4b3329f4b5bb08132fe7c322d F src/btree.h a61ddebc78c66795a2b93181321a116746302cc9 F src/btreeInt.h f038e818bfadf75afbd09819ed93c26a333d39e0 F src/build.c 07054d45319953e54a89d726e589a423e9c1c590 @@ -1145,7 +1145,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P 15e4f63d1f3cbcd0aa789fd3e460cd6e4d3338f9 -R 962cc490e8fc3a8042a30112d4f3290d +P f865be10e85a4063394a21827db2d854fc25960c +R b4c7c44fd7f9f4c41a202ec1f5d2e636 U drh -Z d6583fce3162aa40a5f7e6ad518960af +Z 430bb09012d5a037af5177ecb970e2fe diff --git a/manifest.uuid b/manifest.uuid index a0b1398f2f..4da7a7d3de 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f865be10e85a4063394a21827db2d854fc25960c \ No newline at end of file +55ec474db8935ef36fae30da5d11f5701c60c088 \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index 27e7146893..30fdf4256f 100644 --- a/src/btree.c +++ b/src/btree.c @@ -694,6 +694,10 @@ static int btreeMoveto( ); if( pIdxKey==0 ) return SQLITE_NOMEM; sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey, pIdxKey); + if( pIdxKey->nField==0 ){ + sqlite3DbFree(pCur->pKeyInfo->db, pFree); + return SQLITE_CORRUPT_BKPT; + } }else{ pIdxKey = 0; }