summaryrefslogtreecommitdiffstats
path: root/web/attachments/318264-check_snmp_max_oids.patch
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/318264-check_snmp_max_oids.patch')
-rw-r--r--web/attachments/318264-check_snmp_max_oids.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/web/attachments/318264-check_snmp_max_oids.patch b/web/attachments/318264-check_snmp_max_oids.patch
new file mode 100644
index 0000000..c2a3217
--- /dev/null
+++ b/web/attachments/318264-check_snmp_max_oids.patch
@@ -0,0 +1,15 @@
1diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
2index 3dc52df..41a5ea1 100644
3--- a/plugins/check_snmp.c
4+++ b/plugins/check_snmp.c
5@@ -527,9 +527,8 @@ process_arguments (int argc, char **argv)
6 needmibs = TRUE;
7 }
8 oids = calloc(MAX_OIDS, sizeof (char *));
9- for (ptr = strtok(optarg, ", "); ptr != NULL; ptr = strtok(NULL, ", ")) {
10+ for (ptr = strtok(optarg, ", "); ptr != NULL && j < MAX_OIDS; ptr = strtok(NULL, ", "), j++) {
11 oids[j] = strdup(ptr);
12- j++;
13 }
14 numoids = j;
15 if (c == 'E' || c == 'e') {