diff options
author | drh <drh@noemail.net> | 2008-11-20 18:20:28 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2008-11-20 18:20:28 +0000 |
commit | d164fd3483019f7ee1c79e39ad33ebfa22b63597 (patch) | |
tree | 427053d135aff5ce1e7420ccc787fe1a990fb6c3 /src | |
parent | c7b7f1ae1ddda6c6637c0fb1e3e680de6f9d9aac (diff) | |
download | sqlite-d164fd3483019f7ee1c79e39ad33ebfa22b63597.tar.gz sqlite-d164fd3483019f7ee1c79e39ad33ebfa22b63597.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/printf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/printf.c b/src/printf.c index 59d09801d..8729f39d8 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; } |