From: drh Date: Wed, 17 Jun 2009 22:50:41 +0000 (+0000) Subject: Avoid an assertion fault if an out-of-memory error occurs while trying X-Git-Tag: cvs-to-fossil-cutover~194 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a0c065211114f58515358353e154d0126e56afeb;p=thirdparty%2Fsqlite.git Avoid an assertion fault if an out-of-memory error occurs while trying to run the string-concatentation operator on a zero-blob. (This is an absurd thing to do, but even so, we still should not fault.) (CVS 6778) FossilOrigin-Name: 0def0b76b9f4de9ee259ab1cbe71051fd58b73be --- diff --git a/manifest b/manifest index ad0d995ae9..4e1e5d3a36 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sproblem\sin\svdbe.c\sthat\scould\scause\sa\sdouble-free\sof\smemory\sif\sthe\nSQLITE_LIMIT_LENGTH\sis\schanged\safter\sa\sstatement\sis\sprepared\sbut\sbefore\nit\sis\srun.\s\sAlso\sremove\sdebugging\sstatements\sfrom\stkt3841.test.\s(CVS\s6777) -D 2009-06-17T21:42:34 +C Avoid\san\sassertion\sfault\sif\san\sout-of-memory\serror\soccurs\swhile\strying\nto\srun\sthe\sstring-concatentation\soperator\son\sa\szero-blob.\s\s(This\sis\san\nabsurd\sthing\sto\sdo,\sbut\seven\sso,\swe\sstill\sshould\snot\sfault.)\s(CVS\s6778) +D 2009-06-17T22:50:42 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 8b8fb7823264331210cddf103831816c286ba446 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -203,7 +203,7 @@ F src/update.c 6ae6c26adff8dc34532d578f66e6cfde04b5d177 F src/utf.c 9541d28f40441812c0b40f00334372a0542c00ff F src/util.c a7e981e032c3c9c0887d50d7e658a33cb355b43d F src/vacuum.c 0e14f371ea3326c6b8cfba257286d798cd20db59 -F src/vdbe.c d382d0d12b4a5145a10c85dfcefa3cff1fa5002d +F src/vdbe.c 52863ed40dbec5eeafcb931f0b05245508fe7779 F src/vdbe.h 35a648bc3279a120da24f34d9a25213ec15daf8a F src/vdbeInt.h 3727128255a93d116e454f67d4559700f7ae4d6f F src/vdbeapi.c 619992b16821b989050e8a12e259d795d30731a9 @@ -736,7 +736,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P 392559465d499f491907ef7f42d37a1a6c699511 -R 4f6b7052db49e44ba50de0737b43be98 +P 3d7327fd6af983d5ce9bc9a2ba869b23c44cc8e6 +R 6687213aa06329895696faa25248eff6 U drh -Z cabaf1e4011b7132c3e2e40c4a755bb0 +Z dfb46c4da91bb75fbbcc6b09c978a967 diff --git a/manifest.uuid b/manifest.uuid index 18703bf864..b502082428 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3d7327fd6af983d5ce9bc9a2ba869b23c44cc8e6 \ No newline at end of file +0def0b76b9f4de9ee259ab1cbe71051fd58b73be \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index 3945cbecc7..5e39e9bbdc 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -43,7 +43,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.853 2009/06/17 21:42:34 drh Exp $ +** $Id: vdbe.c,v 1.854 2009/06/17 22:50:42 drh Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -1155,9 +1155,8 @@ case OP_Concat: { /* same as TK_CONCAT, in1, in2, out3 */ sqlite3VdbeMemSetNull(pOut); break; } - ExpandBlob(pIn1); + if( ExpandBlob(pIn1) || ExpandBlob(pIn2) ) goto no_mem; Stringify(pIn1, encoding); - ExpandBlob(pIn2); Stringify(pIn2, encoding); nByte = pIn1->n + pIn2->n; if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){