Check that the hostname field in received packets is NUL-terminated.

This commit is contained in:
Ben Smithurst 2001-01-01 18:43:21 +00:00
parent afd27fce94
commit cfc038e79c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=70561

View File

@ -230,6 +230,13 @@ again:
continue;
}
if (memchr(msgin.tsp_name,
'\0', sizeof msgin.tsp_name) == NULL) {
syslog(LOG_NOTICE, "hostname field not NUL terminated "
"in packet from %s", inet_ntoa(from.sin_addr));
continue;
}
fromnet = NULL;
for (ntp = nettab; ntp != NULL; ntp = ntp->next)
if ((ntp->mask & from.sin_addr.s_addr) ==