summaryrefslogtreecommitdiff
path: root/mkfs.c
diff options
context:
space:
mode:
authorHolger Hoffstätte <holger.hoffstaette@googlemail.com>2014-04-26 09:41:04 +0000
committerDavid Sterba <dsterba@suse.cz>2014-05-02 17:05:47 +0200
commitaf0d2f88959d41488a83df4237e0c1f4c65836ed (patch)
treea2a9fa0e1782b1f58d6490f4fdc764b62171fb80 /mkfs.c
parent091ba6ad9842955604e36f3326fa49ba361ccb9d (diff)
btrfs-progs: fix mkfs.btrfs segfault with --features option
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 <holger.hoffstaette@googlemail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'mkfs.c')
-rw-r--r--mkfs.c2
1 files changed, 1 insertions, 1 deletions
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}
};