1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2025-02-08 03:54:18 +01:00

Limit action length when parsing arguments

This limits the allowable action length when arguments are parsed to
ACTION_MAX_LEN, since this might be exploited otherwise.
This commit is contained in:
Karol Babioch 2018-05-04 17:01:38 +02:00
parent 89c1622ba2
commit c32ddd9665

View File

@ -105,7 +105,10 @@ parse_args(int argc, char **argv,
*slot = 2; *slot = 2;
break; break;
case 'A': case 'A':
snprintf(*action, ACTION_MAX_LEN, "%s", optarg); if (snprintf(*action, ACTION_MAX_LEN, "%s", optarg) >= ACTION_MAX_LEN) {
fprintf(stderr, "action too long: %s\n", optarg);
exit(1);
}
break; break;
case 'p': case 'p':
*output_dir = optarg; *output_dir = optarg;