Permalink
Browse files

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

  • Loading branch information...
yangtse committed Jan 2, 2012
1 parent 8e25d1b commit cc69e56ce3bead7d61e30ec5770072e2f499773a
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/hostip.c
View
@@ -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++;
}

0 comments on commit cc69e56

Please sign in to comment.