From 7608dd74d73b66595ad34c861491fc86be335e8c Mon Sep 17 00:00:00 2001 From: Serge Ziryukin Date: Sun, 25 Apr 2010 19:48:03 +0300 Subject: check for valid optarg before using strdup Signed-off-by: Serge Ziryukin Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- src/pacman/pacman.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pacman') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 744b1899..e601a14d 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -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; -- cgit v1.2.3-70-g09d2