--------------------- PatchSet 10335 Date: 2007/12/28 06:50:38 Author: adri Branch: s27_adri Tag: (none) Log: Fix random out-of-bounds accesses. Thanks valgrind. Members: libhttp/HttpStrList.c:1.1.2.4->1.1.2.5 Index: squid/libhttp/HttpStrList.c =================================================================== RCS file: /cvsroot/squid-sf//squid/libhttp/Attic/HttpStrList.c,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid/libhttp/HttpStrList.c 22 Dec 2007 14:45:21 -0000 1.1.2.4 +++ squid/libhttp/HttpStrList.c 28 Dec 2007 06:50:38 -0000 1.1.2.5 @@ -1,6 +1,6 @@ /* - * $Id: HttpStrList.c,v 1.1.2.4 2007/12/22 14:45:21 adri Exp $ + * $Id: HttpStrList.c,v 1.1.2.5 2007/12/28 06:50:38 adri Exp $ * * DEBUG: section 66 HTTP Header Tools * AUTHOR: Alex Rousskov @@ -159,7 +159,7 @@ /* find next delimiter */ do { (*ipos) = strCSpn(*str, *ipos, delim[quoted]); - if (strGetPos(*str, *ipos) == del) + if (*ipos >= strLen(*str) || strGetPos(*str, *ipos) == del) break; if (strGetPos(*str, *ipos) == '"') { quoted = !quoted; @@ -175,7 +175,7 @@ len = *ipos - ii; /* *pos points to del or '\0' */ /* rtrim */ - while (len > 0 && xisspace(strGetPos(*str, len))) + while (len > 0 && len < strLen2(*str) && xisspace(strGetPos(*str, len))) len--; if (ilen) *ilen = len;