Cleaned up code that prevents crash on malformed item in nodelist

This commit is contained in:
Ken Bowley 2001-10-01 05:36:26 +00:00
parent f32a6e22bf
commit 29da593874

View File

@ -627,8 +627,7 @@ int compile(char *nlname, unsigned short zo, unsigned short ne, unsigned short n
if ((q = strchr(p, ','))) if ((q = strchr(p, ',')))
*q++ = '\0'; *q++ = '\0';
} }
if ((strlen(p) == 3) && (!strcmp(p, "300"))) { if ((strlen(p) == 3) && (!strcmp(p, "300")) && (q != NULL)) {
if (q != NULL) {
if ((strstr(q, (char *)"X75")) || if ((strstr(q, (char *)"X75")) ||
(strstr(q, (char *)"V110L")) || (strstr(q, (char *)"V110L")) ||
(strstr(q, (char *)"V110H")) || (strstr(q, (char *)"V110H")) ||
@ -644,7 +643,6 @@ int compile(char *nlname, unsigned short zo, unsigned short ne, unsigned short n
(strstr(q, (char *)"IP"))) (strstr(q, (char *)"IP")))
ndx.pflag |= NL_TCPIP; ndx.pflag |= NL_TCPIP;
} }
}
Syslog('S',"put: %u:%u/%u.%u reg %u upl %u/%u typ %u flg %02X as (%u,%lu)", Syslog('S',"put: %u:%u/%u.%u reg %u upl %u/%u typ %u flg %02X as (%u,%lu)",
ndx.zone,ndx.net,ndx.node, ndx.zone,ndx.net,ndx.node,