From af0d2f88959d41488a83df4237e0c1f4c65836ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= Date: Sat, 26 Apr 2014 09:41:04 +0000 Subject: btrfs-progs: fix mkfs.btrfs segfault with --features option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mkfs.btrfs --features long option takes an argument but does not declare it. Consequently getopt does not allocate an argument, which makes an unconditional strdup() crash during options parsing. Fix by declaring the argument in the options alias array. Signed-off-by: Holger Hoffstätte Signed-off-by: David Sterba --- mkfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkfs.c') diff --git a/mkfs.c b/mkfs.c index 4f5ee07e..16e92221 100644 --- a/mkfs.c +++ b/mkfs.c @@ -350,7 +350,7 @@ static struct option long_options[] = { { "version", 0, NULL, 'V' }, { "rootdir", 1, NULL, 'r' }, { "nodiscard", 0, NULL, 'K' }, - { "features", 0, NULL, 'O' }, + { "features", 1, NULL, 'O' }, { NULL, 0, NULL, 0} }; -- cgit v1.2.3