summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2012-01-02 13:44:56 +0100
committerYang Tse <yangsita@gmail.com>2012-01-02 13:44:56 +0100
commitcc69e56ce3bead7d61e30ec5770072e2f499773a (patch)
treef61781978a9b7370567210f54b3d262c87c730cc
parent8e25d1b93b590afb923f033810ae52fe88db3b16 (diff)
downloadcurl-cc69e56ce3bead7d61e30ec5770072e2f499773a.tar.gz
hostip.c: fix potential write past the end of string buffer
-rw-r--r--lib/hostip.c2
1 files changed, 1 insertions, 1 deletions
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++;
}