mirror of
https://github.com/Yubico/yubico-pam.git
synced 2025-02-07 18:54:20 +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:
parent
89c1622ba2
commit
c32ddd9665
@ -105,7 +105,10 @@ parse_args(int argc, char **argv,
|
||||
*slot = 2;
|
||||
break;
|
||||
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;
|
||||
case 'p':
|
||||
*output_dir = optarg;
|
||||
|
Loading…
x
Reference in New Issue
Block a user