mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-05-28 04:35:40 -04:00
check_snmp: Fix potential buffer overflow - enforce MAX_OIDS limit (John A. Barbuto)
This commit is contained in:
parent
d5ea0d19fa
commit
e9f5442bb3
1 changed files with 1 additions and 2 deletions
|
|
@ -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') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue