summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSerge Ziryukin <ftrvxmtrx@gmail.com>2010-04-25 18:48:03 +0200
committerDan McGee <dan@archlinux.org>2010-04-26 21:50:31 +0200
commit7608dd74d73b66595ad34c861491fc86be335e8c (patch)
tree231e8905558e0ee240d17ece3784b63f47701499 /src
parent88254d762d68f93b2be04e686abbc126e2afcf11 (diff)
downloadpacman-7608dd74d73b66595ad34c861491fc86be335e8c.tar.gz
pacman-7608dd74d73b66595ad34c861491fc86be335e8c.tar.xz
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>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/pacman.c1
1 files changed, 1 insertions, 0 deletions
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;