cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: http digest input parse fix

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sat, 31 Jul 2004 09:29:01 +0200 (CEST)

On Sat, 31 Jul 2004, Daniel Stenberg wrote:

> I think a better fix adds the proper length. 3 if the content is within
> quotes, and 1 if no quotes were used.

Like this:

--- lib/http_digest.c 24 Jun 2004 11:54:11 -0000 1.21
+++ lib/http_digest.c 31 Jul 2004 07:30:37 -0000
@@ -168,7 +168,12 @@
          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 */

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-07-31