diff options
author | kris <kris@FreeBSD.org> | 2000-06-08 03:54:45 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2000-06-08 03:54:45 +0000 |
commit | c8fe54863b6853deef6390eb994616a224088578 (patch) | |
tree | 09ba95c0c9de0d6e755ce6eba61c4bb9dda0c107 /usr.sbin/syslogd/syslogd.c | |
parent | 0dc3aa298efaec28610046abf84414c013b1c7e2 (diff) | |
download | FreeBSD-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
Diffstat (limited to 'usr.sbin/syslogd/syslogd.c')
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 6 |
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), |