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) */
snmp_free_pdu(res);
res = NULL;
-
if (status == 0)
csnmp_dispatch_table(host, data, instance_list_head, value_list_head);