summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2014-04-20 16:23:34 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2014-04-20 16:23:34 +0000
commitf4c5b12fb107a807d1fce238c5a5f27947dfae8b (patch)
tree093e7bc4f453a2cd9ce79edc733305219b6157d3 /usr.sbin
parent3fbab6e8a8587a922f51a431fc38a53ef70f019f (diff)
Check another strlcpy overflow that is very unlikely to happen.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/relayd/snmp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/relayd/snmp.c b/usr.sbin/relayd/snmp.c
index e8099b5b648..20944137ade 100644
--- a/usr.sbin/relayd/snmp.c
+++ b/usr.sbin/relayd/snmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmp.c,v 1.14 2014/04/14 12:58:04 blambert Exp $ */
+/* $OpenBSD: snmp.c,v 1.15 2014/04/20 16:23:33 reyk Exp $ */
/*
* Copyright (c) 2008 Reyk Floeter <reyk@openbsd.org>
@@ -97,7 +97,9 @@ snmp_setsock(struct relayd *env, enum privsep_procid id)
bzero(&sun, sizeof(sun));
sun.sun_family = AF_UNIX;
- strlcpy(sun.sun_path, env->sc_snmp_path, sizeof(sun.sun_path));
+ if (strlcpy(sun.sun_path, env->sc_snmp_path,
+ sizeof(sun.sun_path)) >= sizeof(sun.sun_path))
+ fatalx("invalid socket path");
socket_set_blockmode(s, BM_NONBLOCK);