hostip.c: fix potential write past the end of string buffer

This commit is contained in:
Yang Tse 2012-01-02 13:44:56 +01:00
parent 8e25d1b93b
commit cc69e56ce3

View File

@ -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++;
}