diff options
author | Yang Tse <yangsita@gmail.com> | 2012-01-02 13:44:56 +0100 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2012-01-02 13:44:56 +0100 |
commit | cc69e56ce3bead7d61e30ec5770072e2f499773a (patch) | |
tree | f61781978a9b7370567210f54b3d262c87c730cc /lib/hostip.c | |
parent | 8e25d1b93b590afb923f033810ae52fe88db3b16 (diff) | |
download | curl-cc69e56ce3bead7d61e30ec5770072e2f499773a.tar.gz |
hostip.c: fix potential write past the end of string buffer
Diffstat (limited to 'lib/hostip.c')
-rw-r--r-- | lib/hostip.c | 2 |
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++; } |