summaryrefslogtreecommitdiff
path: root/usr.sbin/snmpd
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2010-10-15 11:56:14 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2010-10-15 11:56:14 +0000
commit2928669c250156454cc445e95473323b6d433dd2 (patch)
treec15ff1c10004f6f51d757b2d3a21e9bb9a23a9f9 /usr.sbin/snmpd
parent99df037cb5105a4c07a74582022b497e49b86c94 (diff)
return numeric 0 rather than attempting to return a null string,
fixes a segfault when walking memiftable. seems sane to phessler, ok dlg@
Diffstat (limited to 'usr.sbin/snmpd')
-rw-r--r--usr.sbin/snmpd/mib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/snmpd/mib.c b/usr.sbin/snmpd/mib.c
index 9f0b743b8ca..b7886bb548a 100644
--- a/usr.sbin/snmpd/mib.c
+++ b/usr.sbin/snmpd/mib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mib.c,v 1.42 2010/09/23 10:49:55 dlg Exp $ */
+/* $OpenBSD: mib.c,v 1.43 2010/10/15 11:56:13 sthen Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@vantronix.net>
@@ -1428,7 +1428,8 @@ mib_memiftable(struct oid *oid, struct ber_oid *o, struct ber_element **elm)
ber = ber_add_string(ber, kif->if_name);
break;
case 2:
- ber = ber_add_string(ber, 0);
+ ber = ber_add_integer(ber, 0);
+ ber_set_header(ber, BER_CLASS_APPLICATION, SNMP_T_COUNTER64);
break;
default:
return (-1);