--------------------- PatchSet 2415 Date: 2001/05/30 23:55:42 Author: hno Branch: etag Tag: (none) Log: The same ugly bug was creeping around at another place as well. Members: src/store.c:1.12.14.11->1.12.14.12 Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store.c,v retrieving revision 1.12.14.11 retrieving revision 1.12.14.12 diff -u -r1.12.14.11 -r1.12.14.12 --- squid/src/store.c 30 May 2001 23:36:25 -0000 1.12.14.11 +++ squid/src/store.c 30 May 2001 23:55:42 -0000 1.12.14.12 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.12.14.11 2001/05/30 23:36:25 hno Exp $ + * $Id: store.c,v 1.12.14.12 2001/05/30 23:55:42 hno Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -552,8 +552,12 @@ } } e += 1; - l -= p - e; + l -= e - p; p = e; + if (l == 0) + break; + assert(l>0); + assert(p < (buf+size)); } state->offset += p - buf; debug(11, 3) ("storeReadVary: %p offset=%d seen_offset=%d\n", data, state->offset, state->seen_offset); @@ -744,6 +748,10 @@ e += 1; l -= e - p; p = e; + if (l == 0) + break; + assert(l>0); + assert(p < (buf+size)); } state->offset += p - buf; debug(11, 3) ("storeReadVary: %p offset=%d seen_offset=%d\n", data, state->offset, state->seen_offset);