bk: 45fbbaaeI5ZowcVlY9P-CI5a9_Mb8w
+* [Bug 798] ntpq [p typo crashes ntpq.
* [Bug 786] Fix refclock_bancomm.c on Solaris.
* [Bug 789] Fix multicast client crypto authentication.
* [Bug 774] parsesolaris.c does not compile under the new Solaris.
cp = hname;
- if(*cp == '[') {
+ if (*cp == '[') {
cp++;
- for(i = 0; *cp != ']'; cp++, i++)
+ for (i = 0; *cp && *cp != ']'; cp++, i++)
name[i] = *cp;
- name[i] = '\0';
- hname = name;
+ if (*cp == ']') {
+ name[i] = '\0';
+ hname = name;
+ } else {
+ return 0;
+ }
}
/*