From 158ff67b5017917ac40f4f2687ac5944d609a7e5 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 23 Jan 2006 13:14:55 +0000 Subject: [PATCH] Work around buggy malloc() implementations that cause problems on malloc(0). Ticket #1572. (CVS 2996) FossilOrigin-Name: ada5490f12795a8d13d0f42077c463709c677846 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/legacy.c | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 085e4c225b..730abebe28 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improve\scoverage\sof\spager.c\sand\sfix\san\sIO\serror\shandling\sbug\sfound\sin\sthe\sprocess.\s(CVS\s2995) -D 2006-01-23T13:09:46 +C Work\saround\sbuggy\smalloc()\simplementations\sthat\scause\sproblems\son\smalloc(0).\nTicket\s#1572.\s(CVS\s2996) +D 2006-01-23T13:14:55 F Makefile.in ab3ffd8d469cef4477257169b82810030a6bb967 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -47,7 +47,7 @@ F src/func.c 96b26601c092b7b43a13e440e3f988b32a385f6a F src/hash.c 8747cf51d12de46512880dfcf1b68b4e24072863 F src/hash.h 1b0c445e1c89ff2aaad9b4605ba61375af001e84 F src/insert.c 4d37e285459af9bc2ff92ae237285b12cd5e8a71 -F src/legacy.c 0fd27db5e07a46853b9876baaa370b40e75a9b40 +F src/legacy.c 86b669707b3cefd570e34154e2f6457547d1df4f F src/main.c 439168db0a830efd0b9e7325aff39adc5524a1b5 F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217 F src/os.c 1d1a61cdf150e9f9520a3bc787c8465148ea2e78 @@ -344,7 +344,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 6385628edd79187dff1687815d0101c31248e54f -R 80ef760a1dd0cc6379cc9e976317f3a0 -U danielk1977 -Z 3aafcdd526d06e6968e5956fe796cd4a +P 6ec8e6b7856a0b394b8497ab9166b882f98124ba +R 4458a3ccbcb564e876c75ec6f51ead97 +U drh +Z 8a56f30daefd849decb2ee9c85f46798 diff --git a/manifest.uuid b/manifest.uuid index b181e18768..9cea81c455 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6ec8e6b7856a0b394b8497ab9166b882f98124ba \ No newline at end of file +ada5490f12795a8d13d0f42077c463709c677846 \ No newline at end of file diff --git a/src/legacy.c b/src/legacy.c index 98f37a922a..12749c1deb 100644 --- a/src/legacy.c +++ b/src/legacy.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: legacy.c,v 1.12 2006/01/18 15:25:17 danielk1977 Exp $ +** $Id: legacy.c,v 1.13 2006/01/23 13:14:55 drh Exp $ */ #include "sqliteInt.h" @@ -68,8 +68,8 @@ int sqlite3_exec( nCallback = 0; nCol = sqlite3_column_count(pStmt); - azCols = sqliteMalloc(2*nCol*sizeof(const char *)); - if( nCol && !azCols ){ + azCols = sqliteMalloc(2*nCol*sizeof(const char *) + 1); + if( azCols==0 ){ goto exec_out; } -- 2.47.2