summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-06-08 03:54:45 +0000
committerkris <kris@FreeBSD.org>2000-06-08 03:54:45 +0000
commitc8fe54863b6853deef6390eb994616a224088578 (patch)
tree09ba95c0c9de0d6e755ce6eba61c4bb9dda0c107
parent0dc3aa298efaec28610046abf84414c013b1c7e2 (diff)
downloadFreeBSD-src-c8fe54863b6853deef6390eb994616a224088578.zip
FreeBSD-src-c8fe54863b6853deef6390eb994616a224088578.tar.gz
Prevent a non-exploitable remote buffer overflow.
Reported by: twitch <twitch@vicar.org> Submitted by: Guido van Rooij <guido@gvr.org> Reviewed by: security-officer
-rw-r--r--usr.sbin/syslogd/syslogd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index ca5391d..6182c01 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -1791,10 +1791,10 @@ validate(sin, hname)
/* traditional behaviour, allow everything */
return 1;
- strncpy(name, hname, sizeof name);
+ strlcpy(name, hname, sizeof name);
if (strchr(name, '.') == NULL) {
- strncat(name, ".", sizeof name - strlen(name) - 1);
- strncat(name, LocalDomain, sizeof name - strlen(name) - 1);
+ strlcat(name, ".", sizeof name);
+ strlcat(name, LocalDomain, sizeof name);
}
dprintf("validate: dgram from IP %s, port %d, name %s;\n",
addr2ascii(AF_INET, &sin->sin_addr, sizeof(struct in_addr), 0),
OpenPOWER on IntegriCloud