summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-01-05 08:51:58 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-01-05 08:51:58 +0000
commit89fe476084d311609b22cf1009fca429fd0e8de0 (patch)
tree56aae71e879800c9dd43b6423f378d1e98abb9ff /usr.sbin
parent6238e8afae865f9c4d7f50a02d45d9c12ccd3683 (diff)
careful about sunx.sun_path termination; matter@research.suspicious.org
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/syslogd/syslogd.c10
1 files changed, 7 insertions, 3 deletions
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: