From: Alexander Dahl <post@lespocky.de>
To: linux-mtd@lists.infradead.org
Cc: Alexander Dahl <post@lespocky.de>
Subject: [PATCH 1/2] ubihealthd: Add missing sentinel in options array
Date: Thu, 3 Oct 2019 08:35:00 +0200 [thread overview]
Message-ID: <20191003063501.18421-2-post@lespocky.de> (raw)
In-Reply-To: <20191003063501.18421-1-post@lespocky.de>
`getopt_long()` requires a null terminated array, otherwise we get
segfaults when passing invalid options.
Fixes: 7f0e2dc21fb2 ("ubi-utils: Implement a ubihealthd")
Signed-off-by: Alexander Dahl <post@lespocky.de>
---
ubi-utils/ubihealthd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ubi-utils/ubihealthd.c b/ubi-utils/ubihealthd.c
index 3e665be..f38235b 100644
--- a/ubi-utils/ubihealthd.c
+++ b/ubi-utils/ubihealthd.c
@@ -56,6 +56,7 @@ static const struct option options[] = {
.flag = NULL,
.val = 'i'
},
+ { /* sentinel */ }
};
static void dolog(const char *fmt, ...)
--
2.20.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2019-10-03 6:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-03 6:34 [PATCH 0/2] ubihealthd: Fix options Alexander Dahl
2019-10-03 6:35 ` Alexander Dahl [this message]
2019-10-03 6:35 ` [PATCH 2/2] ubihealthd: Add option -h/--help Alexander Dahl
2019-10-03 7:54 ` [PATCH 0/2] ubihealthd: Fix options Richard Weinberger
2019-10-07 8:15 ` David Oberhollenzer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191003063501.18421-2-post@lespocky.de \
--to=post@lespocky.de \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).