btrfs-progs: fix mkfs.btrfs segfault with --features option
authorHolger Hoffstätte <holger.hoffstaette@googlemail.com>
Sat, 26 Apr 2014 09:41:04 +0000 (09:41 +0000)
committerDavid Sterba <dsterba@suse.cz>
Fri, 2 May 2014 15:05:47 +0000 (17:05 +0200)
commitaf0d2f88959d41488a83df4237e0c1f4c65836ed
treea2a9fa0e1782b1f58d6490f4fdc764b62171fb80
parent091ba6ad9842955604e36f3326fa49ba361ccb9d
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>
mkfs.c