]> granicus.if.org Git - curl/commitdiff
Joel Chen reported that we assumed content within quotes a bit too much in
authorDaniel Stenberg <daniel@haxx.se>
Sat, 31 Jul 2004 07:36:01 +0000 (07:36 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 31 Jul 2004 07:36:01 +0000 (07:36 +0000)
the digest code. This fixes it.

lib/http_digest.c

index d06453e8af63138ed87bf4bc77742186828cd8f0..cd224625ce194a16046dd0d30b3c54392520f1f7 100644 (file)
@@ -66,7 +66,7 @@ CURLdigest Curl_input_digest(struct connectdata *conn,
   struct SessionHandle *data=conn->data;
   bool before = FALSE; /* got a nonce before */
   struct digestdata *d;
-  
+
   if(proxy) {
     d = &data->state.proxydigest;
   }
@@ -168,7 +168,12 @@ CURLdigest Curl_input_digest(struct connectdata *conn,
         else {
           /* unknown specifier, ignore it! */
         }
-        totlen = strlen(value)+strlen(content)+3;
+        totlen = strlen(value)+strlen(content)+1;
+
+        if(header[strlen(value)+1] == '\"')
+          /* the contents were within quotes, then add 2 for them to the
+             length */
+          totlen += 2;
       }
       else
         break; /* we're done here */