[PATCH 1/2] ubihealthd: Add missing sentinel in options array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



`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@xxxxxxxxxxx>
---
 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/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux