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
This commit is contained in:
drh 2009-06-17 22:50:41 +00:00
parent 3a9cf17d7c
commit a0c0652111
3 changed files with 9 additions and 10 deletions

View File

@ -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

View File

@ -1 +1 @@
3d7327fd6af983d5ce9bc9a2ba869b23c44cc8e6
0def0b76b9f4de9ee259ab1cbe71051fd58b73be

View File

@ -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] ){