diff options
| author | Chris Timmons <cwt@FreeBSD.org> | 1998-12-29 23:14:50 +0000 |
|---|---|---|
| committer | Chris Timmons <cwt@FreeBSD.org> | 1998-12-29 23:14:50 +0000 |
| commit | c807beb49563b21499dcde0e31bbd10b65355a40 (patch) | |
| tree | 8c87497cafa870fde1cd7c8cae9a4a6124235551 /usr.sbin/syslogd | |
| parent | 7a917245568173d0095d8bfc2db89e254bc4e58e (diff) | |
Notes
Diffstat (limited to 'usr.sbin/syslogd')
| -rw-r--r-- | usr.sbin/syslogd/syslogd.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index f8e9aef14b61..523de1af5a67 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94"; #endif static const char rcsid[] = - "$Id: syslogd.c,v 1.44 1998/12/28 00:39:14 cwt Exp $"; + "$Id: syslogd.c,v 1.45 1998/12/29 20:36:22 cwt Exp $"; #endif /* not lint */ /* @@ -741,7 +741,8 @@ logmsg(pri, msg, from, flags) f->f_prevpri = pri; (void)strncpy(f->f_lasttime, timestamp, 15); (void)strncpy(f->f_prevhost, from, - sizeof(f->f_prevhost)); + sizeof(f->f_prevhost)-1); + f->f_prevhost[sizeof(f->f_prevhost)-1] = '\0'; if (msglen < MAXSVLINE) { f->f_prevlen = msglen; (void)strcpy(f->f_prevline, msg); @@ -1466,8 +1467,10 @@ cfline(line, f, prog) switch (*p) { case '@': - (void)strcpy(f->f_un.f_forw.f_hname, ++p); - hp = gethostbyname(p); + (void)strncpy(f->f_un.f_forw.f_hname, ++p, + sizeof(f->f_un.f_forw.f_hname)-1); + f->f_un.f_forw.f_hname[sizeof(f->f_un.f_forw.f_hname)-1] = '\0'; + hp = gethostbyname(f->f_un.f_forw.f_hname); if (hp == NULL) { extern int h_errno; |
