1
0
mirror of https://github.com/openbsd/src.git synced 2026-05-01 17:46:35 +00:00

Make traphandler_parse also set vbinds for SNMPv1 traps.

This also prevents the access of an initialized pointer in
traphandler_fork_handler as found by jan@.

OK jan@
This commit is contained in:
martijn
2020-03-11 06:53:42 +00:00
parent c7c5838477
commit 56e88aeb3e

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: traphandler.c,v 1.15 2019/10/24 12:39:27 tb Exp $ */
/* $OpenBSD: traphandler.c,v 1.16 2020/03/11 06:53:42 martijn Exp $ */
/*
* Copyright (c) 2014 Bret Stephen Lambert <blambert@openbsd.org>
@@ -232,10 +232,13 @@ traphandler_parse(char *buf, size_t n, struct ber_element **req,
switch (vers) {
case SNMP_V1:
if (ober_scanf_elements(elm, "{oSddd",
trapoid, &gtype, &etype, uptime) == -1)
if (ober_scanf_elements(elm, "{oSddde",
trapoid, &gtype, &etype, uptime, &elm) == -1)
goto done;
traphandler_v1translate(trapoid, gtype, etype);
if (elm->be_type != BER_TYPE_SEQUENCE)
goto done;
*vbinds = elm->be_sub;
break;
case SNMP_V2: