1
0
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:
Serge Ziryukin 2010-04-25 19:48:03 +03:00 committed by Dan McGee
parent 88254d762d
commit 7608dd74d7

View File

@ -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;