diff options
Diffstat (limited to 'plugins/check_snmp.c')
-rw-r--r-- | plugins/check_snmp.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 3dc52dff..41a5ea1a 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -527,9 +527,8 @@ process_arguments (int argc, char **argv) needmibs = TRUE; } oids = calloc(MAX_OIDS, sizeof (char *)); - for (ptr = strtok(optarg, ", "); ptr != NULL; ptr = strtok(NULL, ", ")) { + for (ptr = strtok(optarg, ", "); ptr != NULL && j < MAX_OIDS; ptr = strtok(NULL, ", "), j++) { oids[j] = strdup(ptr); - j++; } numoids = j; if (c == 'E' || c == 'e') { |