From c812f9cecc4be2a5ffc29fdc2c45a434f3867e28 Mon Sep 17 00:00:00 2001 From: martijn Date: Tue, 1 Nov 2022 13:34:44 +0000 Subject: [PATCH] On endOfMibView reset OID back to the original requested OID as per RFC3416 section 4.2.2, instead of returning the (internal) current OID, which could happen on empty tables. Found and diff tested by Ryan Freeman (ryan slipgate org) OK sthen@ --- lib/libagentx/agentx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libagentx/agentx.c b/lib/libagentx/agentx.c index 4902069d093..6c929588db1 100644 --- a/lib/libagentx/agentx.c +++ b/lib/libagentx/agentx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agentx.c,v 1.19 2022/10/14 15:26:58 martijn Exp $ */ +/* $OpenBSD: agentx.c,v 1.20 2022/11/01 13:34:44 martijn Exp $ */ /* * Copyright (c) 2019 Martijn van Duren * @@ -3426,6 +3426,8 @@ agentx_varbind_endofmibview(struct agentx_varbind *axv) return; } + bcopy(&(axv->axv_start), &(axv->axv_vb.avb_oid), + sizeof(axv->axv_start)); axv->axv_vb.avb_type = AX_DATA_TYPE_ENDOFMIBVIEW; if (axv->axv_axo != NULL) -- 2.20.1