1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

When a memory allocation fails on the %Q conversion in sqlite3_mprintf(),

make sure the error is reported back up the call stack. (CVS 5933)

FossilOrigin-Name: eebacbc9d7d0625dfbe6367046fa4a0ca9c04e74
This commit is contained in:
drh
2008-11-20 18:20:28 +00:00
parent c7b7f1ae1d
commit d164fd3483
3 changed files with 13 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
C In\sos_win.c,\sif\sSQLITE_TEST\sdefined,\swinRandomness()\sshould\sreturn\sall\szeroes\slike\sos_unix.c.\s(CVS\s5932) C When\sa\smemory\sallocation\sfails\son\sthe\s%Q\sconversion\sin\ssqlite3_mprintf(),\nmake\ssure\sthe\serror\sis\sreported\sback\sup\sthe\scall\sstack.\s(CVS\s5933)
D 2008-11-19T21:35:47 D 2008-11-20T18:20:28
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 0aa7bbe3be6acc4045706e3bb3fd0b8f38f4a3b5 F Makefile.in 0aa7bbe3be6acc4045706e3bb3fd0b8f38f4a3b5
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -147,7 +147,7 @@ F src/pcache.h f20c3e82dd6da622c3fe296170cb1801f9a2d75a
F src/pcache1.c 2453a3e925841fdb610f39bba24def8b2ad4a908 F src/pcache1.c 2453a3e925841fdb610f39bba24def8b2ad4a908
F src/pragma.c 0a5051029c5b687e2f2669d91aa3281ebcbe4fdb F src/pragma.c 0a5051029c5b687e2f2669d91aa3281ebcbe4fdb
F src/prepare.c fcadb25d2ad722d87103517333c825b56b79a770 F src/prepare.c fcadb25d2ad722d87103517333c825b56b79a770
F src/printf.c 5fe6ba48f897caacc8125e3d16c6bbae6b282214 F src/printf.c ce86aed93a704938ca4d0344aaa763271842a4b0
F src/random.c a87afbd598aa877e23ac676ee92fd8ee5c786a51 F src/random.c a87afbd598aa877e23ac676ee92fd8ee5c786a51
F src/resolve.c 4af5391d2b4c1d6c583a6805ac6660181de4545b F src/resolve.c 4af5391d2b4c1d6c583a6805ac6660181de4545b
F src/select.c e01537d4d8b8b81a6507e07ebb17fc232dacdda7 F src/select.c e01537d4d8b8b81a6507e07ebb17fc232dacdda7
@@ -659,7 +659,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
P 01a6e2820af0729f01ce90664ce9a6aa63e5b09a P 00b68a1e3164fbf04dabb480c2037be45612b4e4
R 76c151a976f8d3a735617b3c9cd38e30 R 38e4d91990d6f71d4806b7fd8231a0a6
U shane U drh
Z dc6f492a5f846806441eff5aaa950b52 Z c8c595ff0394bbf0b4f1b46a403a8fd7

View File

@@ -1 +1 @@
00b68a1e3164fbf04dabb480c2037be45612b4e4 eebacbc9d7d0625dfbe6367046fa4a0ca9c04e74

View File

@@ -5,7 +5,7 @@
** an historical reference. Most of the "enhancements" have been backed ** an historical reference. Most of the "enhancements" have been backed
** out so that the functionality is now the same as standard printf(). ** out so that the functionality is now the same as standard printf().
** **
** $Id: printf.c,v 1.95 2008/11/17 19:18:55 danielk1977 Exp $ ** $Id: printf.c,v 1.96 2008/11/20 18:20:28 drh Exp $
** **
************************************************************************** **************************************************************************
** **
@@ -645,7 +645,10 @@ void sqlite3VXPrintf(
n += i + 1 + needQuote*2; n += i + 1 + needQuote*2;
if( n>etBUFSIZE ){ if( n>etBUFSIZE ){
bufpt = zExtra = sqlite3Malloc( n ); bufpt = zExtra = sqlite3Malloc( n );
if( bufpt==0 ) return; if( bufpt==0 ){
pAccum->mallocFailed = 1;
return;
}
}else{ }else{
bufpt = buf; bufpt = buf;
} }