Re: snmpd [15/16]: When we have an error, all oids must be identical to the request

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 03:31:20PM +0200, Martijn van Duren wrote:
> RFC3416 section 4.2.1 (and others) tells us that if an error occurs the
> varbindlist in the response must be identical to the original request.
> 
> There might be other edge-cases here, but let's at least make sure that
> the OIDs haven't been tampered with.

ok



snmpd [15/16]: When we have an error, all oids must be identical to the request

2023-10-17 Thread Martijn van Duren
RFC3416 section 4.2.1 (and others) tells us that if an error occurs the
varbindlist in the response must be identical to the original request.

There might be other edge-cases here, but let's at least make sure that
the OIDs haven't been tampered with.

OK?

martijn@

diff --git a/application.c b/application.c
index 53e793d..d98918f 100644
--- a/application.c
+++ b/application.c
@@ -1186,6 +1186,9 @@ appl_varbind_valid(struct appl_varbind *varbind,
int cmp;
int eomv = 0;
 
+   if (null)
+   next = 0;
+
if (varbind->av_value == NULL) {
if (!null) {
*errstr = "missing value";