From: Yang Tse Date: Mon, 2 Jan 2012 12:44:56 +0000 (+0100) Subject: hostip.c: fix potential write past the end of string buffer X-Git-Tag: curl-7_24_0~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cc69e56ce3bead7d61e30ec5770072e2f499773a;p=curl hostip.c: fix potential write past the end of string buffer --- diff --git a/lib/hostip.c b/lib/hostip.c index 828d27e42..503ba483f 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -212,7 +212,7 @@ create_hostcache_id(const char *name, int port) char *ptr = id; if(ptr) { /* lower case the name part */ - while(*ptr != ':') { + while(*ptr && (*ptr != ':')) { *ptr = (char)TOLOWER(*ptr); ptr++; }