From d44860c325b0044d5c9c37832efad8bb02eb7d4d Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 17 Jun 2015 19:12:45 +0200 Subject: [PATCH] snmp plugin: Fix off-by-one array access. --- src/snmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/snmp.c b/src/snmp.c index 7d340d18..362f175c 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -1341,7 +1341,7 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data) for (vb = res->variables, i = 0; (vb != NULL); vb = vb->next_variable, i++) { /* Calculate value index from todo list */ - while (!oid_list_todo[i] && (i < oid_list_len)) + while ((i < oid_list_len) && !oid_list_todo[i]) i++; /* An instance is configured and the res variable we process is the -- 2.30.2