From: danielk1977 Date: Thu, 29 Mar 2007 15:00:52 +0000 (+0000) Subject: Assume the malloc-failed flag cannot already be set when calling sqlite3_errmsg(16... X-Git-Tag: version-3.6.10~2425 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae7fc49deffe4bcc728a210199354e4b2dae9c9c;p=thirdparty%2Fsqlite.git Assume the malloc-failed flag cannot already be set when calling sqlite3_errmsg(16)(). (CVS 3745) FossilOrigin-Name: 54fa22273d551e00e1abd86992ff7c62ec4e0daf --- diff --git a/manifest b/manifest index 346e50f0e1..f34f66db28 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sbug\sin\sXFER\soptimization\sintroduced\sby\scheck-in\s(3736).\s(CVS\s3744) -D 2007-03-29T13:35:36 +C Assume\sthe\smalloc-failed\sflag\scannot\salready\sbe\sset\swhen\scalling\ssqlite3_errmsg(16)().\s(CVS\s3745) +D 2007-03-29T15:00:53 F Makefile.in 2f2c3bf69faf0ae7b8e8af4f94f1986849034530 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -73,7 +73,7 @@ F src/hash.h 1b3f7e2609141fd571f62199fc38687d262e9564 F src/insert.c aa61e77807becb8b6c3ffcf53be98d20b0e6f107 F src/legacy.c 2631df6a861f830d6b1c0fe92b9fdd745b2c0cd6 F src/loadext.c c186ad5c9e8a0aaa73d0caf5f604d112e45e8b89 -F src/main.c ed005bbc1d94670c8d9e2b93d446bd493119c44c +F src/main.c 3ca92e8f2397da413c39f5a102e5675f5c5fa78a F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217 F src/os.c 6df3e9c23eaa982d3e66ef770ad2519de5dd4d97 F src/os.h ec780b3561d0bb887d13f193a1a889872c44a236 @@ -444,7 +444,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 0b7bd9c315501743e2364ecccefeeba326d5df51 -R f835600d7a31bbad1e89e4ca703027c6 -U drh -Z 99dd3cdc6da74be6f4ae843c87cb0d89 +P 3714ac173289e580a0302a5a3beac05823d92c5b +R 3cfcb502e90a93f72d96670b4207913a +U danielk1977 +Z 7e6377bdbc94cfb816f281bbc3868b86 diff --git a/manifest.uuid b/manifest.uuid index 92a78ebe08..e342a433b9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3714ac173289e580a0302a5a3beac05823d92c5b \ No newline at end of file +54fa22273d551e00e1abd86992ff7c62ec4e0daf \ No newline at end of file diff --git a/src/main.c b/src/main.c index 46d8c993db..57833fff50 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.362 2007/03/27 22:24:11 drh Exp $ +** $Id: main.c,v 1.363 2007/03/29 15:00:53 danielk1977 Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -730,7 +730,8 @@ int sqlite3BtreeFactory( */ const char *sqlite3_errmsg(sqlite3 *db){ const char *z; - if( !db || sqlite3MallocFailed() ){ + assert( !sqlite3MallocFailed() ); + if( !db ){ return sqlite3ErrStr(SQLITE_NOMEM); } if( sqlite3SafetyCheck(db) || db->errCode==SQLITE_MISUSE ){ @@ -769,7 +770,8 @@ const void *sqlite3_errmsg16(sqlite3 *db){ }; const void *z; - if( sqlite3MallocFailed() ){ + assert( !sqlite3MallocFailed() ); + if( !db ){ return (void *)(&outOfMemBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]); } if( sqlite3SafetyCheck(db) || db->errCode==SQLITE_MISUSE ){