commit | cc69e56ce3bead7d61e30ec5770072e2f499773a | [log] [tgz] |
---|---|---|
author | Yang Tse <yangsita@gmail.com> | Mon Jan 02 13:44:56 2012 +0100 |
committer | Yang Tse <yangsita@gmail.com> | Mon Jan 02 13:44:56 2012 +0100 |
tree | f61781978a9b7370567210f54b3d262c87c730cc | |
parent | 8e25d1b93b590afb923f033810ae52fe88db3b16 [diff] |
hostip.c: fix potential write past the end of string buffer
diff --git a/lib/hostip.c b/lib/hostip.c index 828d27e..503ba48 100644 --- a/lib/hostip.c +++ b/lib/hostip.c
@@ -212,7 +212,7 @@ char *ptr = id; if(ptr) { /* lower case the name part */ - while(*ptr != ':') { + while(*ptr && (*ptr != ':')) { *ptr = (char)TOLOWER(*ptr); ptr++; }