]> granicus.if.org Git - curl/commitdiff
- Andre Guibert de Bruet correctly pointed out an over-alloc with one wasted
authorDaniel Stenberg <daniel@haxx.se>
Sun, 10 May 2009 21:33:55 +0000 (21:33 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 10 May 2009 21:33:55 +0000 (21:33 +0000)
  byte in the digest code.

CHANGES
lib/http_digest.c

diff --git a/CHANGES b/CHANGES
index 0a144e5b28087a2036937c8898a082cb1caebfbd..adcd4fce363468d48bcc1670bc77b9675bbd5729 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,10 @@
 
                                   Changelog
 
+Daniel Stenberg (10 May 2009)
+- Andre Guibert de Bruet correctly pointed out an over-alloc with one wasted
+  byte in the digest code.
+
 Yang Tse (9 May 2009)
 - Removed DOS and TPF package's subdirectory Makefile.am, it was only used
   to include some files in the distribution tarball serving no other purpose.
index b370891b74b117e275a43a476fe619d000a14e09..7011b19472b9c8745e3a93cff23e0c2e974dbe89 100644 (file)
@@ -543,8 +543,8 @@ CURLcode Curl_output_digest(struct connectdata *conn,
     *allocuserpwd = tmp;
   }
 
-  /* append CRLF to the userpwd header */
-  tmp = realloc(*allocuserpwd, strlen(*allocuserpwd) + 3 + 1);
+  /* append CRLF + zero (3 bytes) to the userpwd header */
+  tmp = realloc(*allocuserpwd, strlen(*allocuserpwd) + 3);
   if(!tmp)
     return CURLE_OUT_OF_MEMORY;
   strcat(tmp, "\r\n");