--------------------- PatchSet 10384 Date: 2008/01/09 09:52:43 Author: adri Branch: s27_adri Tag: (none) Log: isspace() includes '\r' and '\n', which isn't good when we're intending to walk over '\t' and '\n'. Members: libhttp/HttpHeader.c:1.1.2.5->1.1.2.6 Index: squid/libhttp/HttpHeader.c =================================================================== RCS file: /cvsroot/squid-sf//squid/libhttp/Attic/HttpHeader.c,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- squid/libhttp/HttpHeader.c 6 Jan 2008 10:25:07 -0000 1.1.2.5 +++ squid/libhttp/HttpHeader.c 9 Jan 2008 09:52:43 -0000 1.1.2.6 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.c,v 1.1.2.5 2008/01/06 10:25:07 adri Exp $ + * $Id: HttpHeader.c,v 1.1.2.6 2008/01/09 09:52:43 adri Exp $ */ #include @@ -26,6 +26,8 @@ #include "HttpHeaderEntry.h" #include "HttpHeader.h" +#define xisspacetab(a) ( (a) == '\t' || (a) == '\v' || (a) == ' ' ) + HttpHeaderFieldInfo *Headers = NULL; static int @@ -120,7 +122,7 @@ break; } /* find first non-whitespace: that'll be field start (even though it shouldn't be!) */ - for (; n < buf_len(buf) && isspace(b[n]); n++); + for (; n < buf_len(buf) && xisspacetab(b[n]); n++); if (n >= buf_len(buf)) { retcode = 0; break; @@ -128,7 +130,7 @@ fs = n; /* find whitespace/: ; end of field */ - for (; n < buf_len(buf) && (! isspace(b[n])) && (b[n] != ':'); n++); + for (; n < buf_len(buf) && (! xisspacetab(b[n])) && (b[n] != ':'); n++); if (n >= buf_len(buf)) { retcode = 0; break; @@ -149,7 +151,7 @@ n++; /* find first non-whitespace; that'll be value start */ - for (; n < buf_len(buf) && isspace(b[n]); n++); + for (; n < buf_len(buf) && xisspacetab(b[n]); n++); if (n >= buf_len(buf)) { retcode = 0; break;