From: Andrei Cipu Date: Wed, 4 Apr 2012 12:35:24 +0000 (+0300) Subject: IPv6 cookie domain: get rid of the first bracket before the second. X-Git-Tag: curl-7_26_0~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad595c3ba9f26f7713ba80da6624d0a391f98d91;p=thirdparty%2Fcurl.git IPv6 cookie domain: get rid of the first bracket before the second. Commit 97b66ebe was copying a smaller buffer, thus duplicating the last character. --- diff --git a/lib/http.c b/lib/http.c index ec76bbe46b..0ce575ba8c 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1852,12 +1852,12 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) int startsearch = 0; if(*cookiehost == '[') { char *closingbracket; - closingbracket = strchr(cookiehost+1, ']'); - if(closingbracket) - *closingbracket = 0; /* since the 'cookiehost' is an allocated memory area that will be freed later we cannot simply increment the pointer */ memmove(cookiehost, cookiehost + 1, strlen(cookiehost) - 1); + closingbracket = strchr(cookiehost, ']'); + if(closingbracket) + *closingbracket = 0; } else { char *colon = strchr(cookiehost + startsearch, ':');