At 07:24 01/08/2002 +0200, Marc Boucher wrote:
> The code is almost completely rewritten.
Sorry, but while rewriting the code, I forgot to increase the memory size
of the block containing the headers. That's WRONG (buffer overflow).
That's the cost of working overnight.  ;)

In fact the old code only needed 2 corrections to work properly. It was my
fault of not seeing the second one that pushed me to rewrite the whole thing.
Here is the correct patch with only slight modifications on the original code.

Sorry for this error.


-- 
Marc
--- headbody.c  Fri Jul 19 20:15:02 2002
+++ headbody.c  Fri Aug  2 16:21:58 2002
@@ -539,7 +539,9 @@
        'expires=Wdy, DD-Mon-YY HH:MM:SS GMT' and contains an embedded ','!
      */
 
-    if(!strcmp(head->key[i],"Set-Cookie"))
+    /* Doesn't work at all. Modified by Marc Boucher, 01-aug-2002  */
+
+    if(!strcasecmp(head->key[i],"Set-Cookie")) // header also found spelled as 
+"Set-cookie", using strcasecmp instead.
       {
        char **list=split_header_list(head->val[i]),**l;
        int nlist=0;
@@ -559,7 +561,10 @@
           strcpy(p,": ");         p+=2;
           while(*lp && *lp!=',')
              *p++=*lp++;
-          if(**(l+1) && lp>(*l+10) && strncasecmp(p-10,"expires=",8))
+
+          // strcasecmp is not for string lookup. Use strstr instead
+          // going back 10 chars isn't enough, 20 is OK (size of "expire" + day of 
+week).
+          if(**(l+1) && lp>(*l+10) && strstr(p-20,"expires="))
             {
              *p++=',';
              *p++=' ';

Reply via email to