* [PATCH] btrfs-progs: fix mkfs.btrfs segfault with --features option
@ 2014-04-26 9:41 Holger Hoffstätte
0 siblings, 0 replies; only message in thread
From: Holger Hoffstätte @ 2014-04-26 9:41 UTC (permalink / raw)
To: linux-btrfs
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>
---
mkfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkfs.c b/mkfs.c
index dbd83f5..173972c 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}
};
--
1.9.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-04-26 9:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-26 9:41 [PATCH] btrfs-progs: fix mkfs.btrfs segfault with --features option Holger Hoffstätte
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).