[1/2] ubihealthd: Add missing sentinel in options array
diff mbox series

Message ID 20191003063501.18421-2-post@lespocky.de
State Accepted
Delegated to: Richard Weinberger
Headers show
Series
  • ubihealthd: Fix options
Related show

Commit Message

Alexander Dahl Oct. 3, 2019, 6:35 a.m. UTC
`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(+)

Patch
diff mbox series

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, ...)