From: drh Date: Thu, 20 Nov 2008 18:20:28 +0000 (+0000) Subject: When a memory allocation fails on the %Q conversion in sqlite3_mprintf(), X-Git-Tag: version-3.6.10~244 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d164fd3483019f7ee1c79e39ad33ebfa22b63597;p=thirdparty%2Fsqlite.git 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 --- diff --git a/manifest b/manifest index 9c0d7c6955..2dce09267f 100644 --- a/manifest +++ b/manifest @@ -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) -D 2008-11-19T21:35:47 +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-20T18:20:28 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 0aa7bbe3be6acc4045706e3bb3fd0b8f38f4a3b5 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -147,7 +147,7 @@ F src/pcache.h f20c3e82dd6da622c3fe296170cb1801f9a2d75a F src/pcache1.c 2453a3e925841fdb610f39bba24def8b2ad4a908 F src/pragma.c 0a5051029c5b687e2f2669d91aa3281ebcbe4fdb F src/prepare.c fcadb25d2ad722d87103517333c825b56b79a770 -F src/printf.c 5fe6ba48f897caacc8125e3d16c6bbae6b282214 +F src/printf.c ce86aed93a704938ca4d0344aaa763271842a4b0 F src/random.c a87afbd598aa877e23ac676ee92fd8ee5c786a51 F src/resolve.c 4af5391d2b4c1d6c583a6805ac6660181de4545b F src/select.c e01537d4d8b8b81a6507e07ebb17fc232dacdda7 @@ -659,7 +659,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P 01a6e2820af0729f01ce90664ce9a6aa63e5b09a -R 76c151a976f8d3a735617b3c9cd38e30 -U shane -Z dc6f492a5f846806441eff5aaa950b52 +P 00b68a1e3164fbf04dabb480c2037be45612b4e4 +R 38e4d91990d6f71d4806b7fd8231a0a6 +U drh +Z c8c595ff0394bbf0b4f1b46a403a8fd7 diff --git a/manifest.uuid b/manifest.uuid index 5d472e3714..cb60f91a95 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -00b68a1e3164fbf04dabb480c2037be45612b4e4 \ No newline at end of file +eebacbc9d7d0625dfbe6367046fa4a0ca9c04e74 \ No newline at end of file diff --git a/src/printf.c b/src/printf.c index 59d09801d8..8729f39d81 100644 --- a/src/printf.c +++ b/src/printf.c @@ -5,7 +5,7 @@ ** an historical reference. Most of the "enhancements" have been backed ** 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; if( n>etBUFSIZE ){ bufpt = zExtra = sqlite3Malloc( n ); - if( bufpt==0 ) return; + if( bufpt==0 ){ + pAccum->mallocFailed = 1; + return; + } }else{ bufpt = buf; }