diff options
author | bluhm <bluhm@openbsd.org> | 2019-10-07 07:39:50 +0000 |
---|---|---|
committer | bluhm <bluhm@openbsd.org> | 2019-10-07 07:39:50 +0000 |
commit | 0b8bc7a524c34093ae50976b0334e072c5b046bb (patch) | |
tree | 4b2423d3bb306c22e4c1142c89776226c1e63966 /usr.bin/snmp | |
parent | Fix respawn-pane/window if default-command is set, reported by Janos Barbero. (diff) | |
download | wireguard-openbsd-0b8bc7a524c34093ae50976b0334e072c5b046bb.tar.xz wireguard-openbsd-0b8bc7a524c34093ae50976b0334e072c5b046bb.zip |
If optstring is NULL and usecommonopt is true, optstr was prepended
by uninitialized garbage. Crash in snmp(1) found by
regress/usr.sbin/snmpd.
OK martijn@
Diffstat (limited to 'usr.bin/snmp')
-rw-r--r-- | usr.bin/snmp/snmpc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/snmp/snmpc.c b/usr.bin/snmp/snmpc.c index 54ab70e2359..6ac181e3bd3 100644 --- a/usr.bin/snmp/snmpc.c +++ b/usr.bin/snmp/snmpc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snmpc.c,v 1.13 2019/10/03 11:02:26 martijn Exp $ */ +/* $OpenBSD: snmpc.c,v 1.14 2019/10/07 07:39:50 bluhm Exp $ */ /* * Copyright (c) 2019 Martijn van Duren <martijn@openbsd.org> @@ -128,6 +128,7 @@ main(int argc, char *argv[]) if (argc <= 1) usage(); + optstr[0] = '\0'; for (i = 0; i < sizeof(snmp_apps)/sizeof(*snmp_apps); i++) { if (strcmp(snmp_apps[i].name, argv[1]) == 0) { snmp_app = &snmp_apps[i]; |