summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6b91766)
raw | patch | inline | side by side (parent: 6b91766)
author | Florian Forster <octo@collectd.org> | |
Fri, 17 Nov 2017 13:56:06 +0000 (14:56 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 17 Nov 2017 13:59:37 +0000 (14:59 +0100) |
CID: 81389, 81390
src/snmp.c | patch | blob | history |
diff --git a/src/snmp.c b/src/snmp.c
index 74068ec3d3dbf210a0be6e69bb2832abb17f699f..ffeface9c1968a73a5e92ec7253363811fec0e20 100644 (file)
--- a/src/snmp.c
+++ b/src/snmp.c
@@ -1403,8 +1403,12 @@ 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 ((i < oid_list_len) && !oid_list_todo[i])
+ while ((i < oid_list_len) && !oid_list_todo[i]) {
i++;
+ }
+ if (i >= oid_list_len) {
+ break;
+ }
/* An instance is configured and the res variable we process is the
* instance value (last index) */
@@ -1495,7 +1499,6 @@ static int csnmp_read_table(host_definition_t *host, data_definition_t *data) {
snmp_free_pdu(res);
res = NULL;
-
if (status == 0)
csnmp_dispatch_table(host, data, instance_list_head, value_list_head);