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