mirror of
https://github.com/moparisthebest/pacman
synced 2024-10-31 15:45:03 -04:00
check for valid optarg before using strdup
Signed-off-by: Serge Ziryukin <ftrvxmtrx@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
88254d762d
commit
7608dd74d7
@ -495,6 +495,7 @@ static int parseargs(int argc, char *argv[])
|
||||
setarch(optarg);
|
||||
break;
|
||||
case OP_PRINTFORMAT:
|
||||
check_optarg();
|
||||
config->print_format = strdup(optarg);
|
||||
break;
|
||||
case 'Q': config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_QUERY); break;
|
||||
|
Loading…
Reference in New Issue
Block a user