Fix an off-by-one error in the scratch memory allocator.

FossilOrigin-Name: 5a9591607a0a5ba4527bf2a90179651053244953
This commit is contained in:
drh
2010-09-02 18:13:00 +00:00
parent 1ff6e3ab89
commit 7ff2719e88
3 changed files with 11 additions and 11 deletions
+9 -9
View File
@@ -1,8 +1,8 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
C Use\ssqlite3_mutex_notheld()\sinstead\sof\s!sqlite3_mutex_held()\sinside\nof\sassert()\sstatements\ssince\sthe\sformer\sworks\swhen\smutexing\sis\sdisabled\nwhile\sthe\slatter\sdoes\snot.
D 2010-09-02T17:15:19
C Fix\san\soff-by-one\serror\sin\sthe\sscratch\smemory\sallocator.
D 2010-09-02T18:13:01
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in c599a15d268b1db2aeadea19df2adc3bf2eb6bee
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -142,7 +142,7 @@ F src/legacy.c a199d7683d60cef73089e892409113e69c23a99f
F src/lempar.c 7f026423f4d71d989e719a743f98a1cbd4e6d99e
F src/loadext.c 6d422ea91cf3d2d00408c5a8f2391cd458da85f8
F src/main.c b92c6c9a302999975897730b2808708fbf531a56
F src/malloc.c 2231edbd06f23dd6966f30eda26cb7b365741673
F src/malloc.c e0e9ca16a90215e2f0b53e7f5cc17abe01fbe34a
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c 00bd8265c81abb665c48fea1e0c234eb3b922206
F src/mem2.c e307323e86b5da1853d7111b68fd6b84ad6f09cf
@@ -856,14 +856,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P 2a5eed35b410fb6bd69242841c00700906f48d5f
R 0c22e9c2aca445476ab0951fae018b3f
P 2211486b69cf53f5efb1334aff8b403b26596102
R 58aa05496d4c88e93839c30ad7f0f12f
U drh
Z a9898d4883843bb1e58123dd33c0c45f
Z 9ab20b082ef4d5eb3039a58dec067745
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFMf9uqoxKgR168RlERAgkIAJ4//z+UaADrF2cV99XQ6qH5bKAT7QCggncs
C2rjXXoF03atWsdT31EAiGY=
=MDOk
iD8DBQFMf+kwoxKgR168RlERArAIAJ44f+KasgThCWlpaivQQWtOA27OrACeL7/e
Ym5tzUVAgx/gSuZ7kCIQ05g=
=rGma
-----END PGP SIGNATURE-----
+1 -1
View File
@@ -1 +1 @@
2211486b69cf53f5efb1334aff8b403b26596102
5a9591607a0a5ba4527bf2a90179651053244953
+1 -1
View File
@@ -127,7 +127,7 @@ int sqlite3MallocInit(void){
mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM);
}
if( sqlite3GlobalConfig.pScratch && sqlite3GlobalConfig.szScratch>=100
&& sqlite3GlobalConfig.nScratch>=0 ){
&& sqlite3GlobalConfig.nScratch>0 ){
int i, n, sz;
ScratchFreeslot *pSlot;
sz = ROUNDDOWN8(sqlite3GlobalConfig.szScratch);