From 6245e0d19c27ed66e217e8d871454b6c5e32f060 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 23 Jan 2006 15:39:58 +0000 Subject: [PATCH] Fix a bug in pager.c that was overwriting freed memory. Comment changes in util.c. (CVS 3002) FossilOrigin-Name: 8c7e18c3f2f0487c6125f2d12720669e4d40e760 --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/pager.c | 7 ++----- src/util.c | 10 +++++----- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/manifest b/manifest index 66ae83a65e..5a6012e9fc 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Further\scoverage\simprovements\sfor\spager.c\sand\sanother\sIO\serror\sbug\sfix.\s(CVS\s3001) -D 2006-01-23T15:25:48 +C Fix\sa\sbug\sin\spager.c\sthat\swas\soverwriting\sfreed\smemory.\s\sComment\schanges\nin\sutil.c.\s(CVS\s3002) +D 2006-01-23T15:39:59 F Makefile.in ab3ffd8d469cef4477257169b82810030a6bb967 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -59,7 +59,7 @@ F src/os_unix.c 38a55e51fb2c6f32c0ce86d274f5787f6c3668ed F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_win.c 98e4e38db7d4a00647b2bb1c60d28b7ca5034c03 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b -F src/pager.c 86619d2739fe8757a0d5eff72a02a290b1c3fba0 +F src/pager.c d94bad3ef24095d20f7ca355506daca53d4dec19 F src/pager.h e0acb095b3ad0bca48f2ab00c87346665643f64f F src/parse.y 4285cd2d0f31a8db4c4d54325f88e500452fa029 F src/pragma.c 4496cc77dc35824e1c978c3d1413b8a5a4c777d3 @@ -85,7 +85,7 @@ F src/tokenize.c 9ae9a59238eb97fbc61baea280563b91100518fb F src/trigger.c 4d3644cbd16959b568c95ae73493402be8021b08 F src/update.c 14be4ba2f438919b4217085c02feff569e6cf1f2 F src/utf.c 5ab8ca05d4e9ec81174b010f01ab12a232f0087d -F src/util.c 8c2e824e0bab3e5d1673213235e5dc0bdec441d4 +F src/util.c 82ee598519b8193184bdeab06b51a4ffa05ad60b F src/vacuum.c 3865673cc66acd0717ecd517f6b8fdb2a5e7924b F src/vdbe.c 1b50083eb941eab37ffa220fdc47cf0965a7f176 F src/vdbe.h 8729a4ee16ff9aeab2af9667df3cf300ff978e13 @@ -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 06d6540026568ca69410354ca8d85da78970c94b -R c456675e3ecb5484a33151ee57d158b9 -U danielk1977 -Z d1bfbd0b2d33163ba712dc25d4306067 +P a9ec5ee4724ab993e71ef8b387e2d92f3e74959c +R 49090966cc3b4e7c131019579384b4ba +U drh +Z 3e1c9095bb32c91ba1fc83cfc89e0035 diff --git a/manifest.uuid b/manifest.uuid index 439255412b..240feaba6b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a9ec5ee4724ab993e71ef8b387e2d92f3e74959c \ No newline at end of file +8c7e18c3f2f0487c6125f2d12720669e4d40e760 \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index 500fe17aea..524b690d2e 100644 --- a/src/pager.c +++ b/src/pager.c @@ -18,7 +18,7 @@ ** file simultaneously, or one process from reading the database while ** another is writing. ** -** @(#) $Id: pager.c,v 1.252 2006/01/23 15:25:48 danielk1977 Exp $ +** @(#) $Id: pager.c,v 1.253 2006/01/23 15:39:59 drh Exp $ */ #ifndef SQLITE_OMIT_DISKIO #include "sqliteInt.h" @@ -2694,11 +2694,8 @@ int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){ int rc2 = sqlite3OsFileSize(pPager->fd, &fileSize); if( rc2!=SQLITE_OK || fileSize>=pgno*pPager->pageSize ){ /* An IO error occured in one of the the sqlite3OsSeek() or - ** sqlite3OsRead() calls above. Unreference the page and then - ** set it's page number to 0 (0 means "not a page"). - */ + ** sqlite3OsRead() calls above. */ sqlite3pager_unref(PGHDR_TO_DATA(pPg)); - pPg->pgno = 0; return rc; }else{ clear_simulated_io_error(); diff --git a/src/util.c b/src/util.c index 9f4d082467..cb93a76c83 100644 --- a/src/util.c +++ b/src/util.c @@ -14,7 +14,7 @@ ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** -** $Id: util.c,v 1.181 2006/01/23 13:00:38 drh Exp $ +** $Id: util.c,v 1.182 2006/01/23 15:39:59 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -25,7 +25,7 @@ ** MALLOC WRAPPER ARCHITECTURE ** ** The sqlite code accesses dynamic memory allocation/deallocation by invoking -** the following four APIs (which may be implemented as macros). +** the following six APIs (which may be implemented as macros). ** ** sqlite3Malloc() ** sqlite3MallocRaw() @@ -37,8 +37,8 @@ ** The function sqlite3FreeX performs the same task as sqlite3Free and is ** guaranteed to be a real function. The same holds for sqlite3MallocX ** -** The above APIs are implemented in terms of the functions provided at the Os -** level (not in this file). The Os level interface is never accessed directly +** The above APIs are implemented in terms of the functions provided in the +** operating-system interface. The OS interface is never accessed directly ** by code outside of this file. ** ** sqlite3OsMalloc() @@ -55,7 +55,7 @@ ** MALLOC TEST WRAPPER ARCHITECTURE ** ** The test wrapper provides extra test facilities to ensure the library -** does not leak memory and handles the failure of the underlying (Os level) +** does not leak memory and handles the failure of the underlying OS level ** allocation system correctly. It is only present if the library is ** compiled with the SQLITE_MEMDEBUG macro set. **