From: Florian Forster Date: Wed, 17 Jun 2015 17:12:45 +0000 (+0200) Subject: snmp plugin: Fix off-by-one array access. X-Git-Tag: collectd-5.5.1~101^2~19 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=d44860c325b0044d5c9c37832efad8bb02eb7d4d;p=collectd.git snmp plugin: Fix off-by-one array access. --- 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