From 89fe476084d311609b22cf1009fca429fd0e8de0 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Tue, 5 Jan 1999 08:51:58 +0000 Subject: careful about sunx.sun_path termination; matter@research.suspicious.org --- usr.sbin/syslogd/syslogd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'usr.sbin/syslogd/syslogd.c') diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 32d30a24562..1068b460b86 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -238,12 +238,16 @@ main(argc, argv) SecureMode = 0; break; case 'a': - if (nfunix < MAXFUNIX) - funixn[nfunix++] = optarg; - else + if (nfunix >= MAXFUNIX) fprintf(stderr, "syslogd: out of descriptors, ignoring %s\n", optarg); + else if (strlen(optarg) >= sizeof(sunx.sun_path)) + fprintf(stderr, + "syslogd: path to long, ignoring %s\n", + optarg); + else + funixn[nfunix++] = optarg; break; case '?': default: -- cgit v1.2.3