]> www.infradead.org Git - mtd-utils.git/commitdiff
ubihealthd: Add missing sentinel in options array
authorAlexander Dahl <post@lespocky.de>
Thu, 3 Oct 2019 06:35:00 +0000 (08:35 +0200)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Mon, 7 Oct 2019 08:14:45 +0000 (10:14 +0200)
`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>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
ubi-utils/ubihealthd.c

index 3e665be455ac6deb8b20b777874cb8e0acc08b1b..f38235b8c3c248213f96c1dd5818b7df32e938c3 100644 (file)
@@ -56,6 +56,7 @@ static const struct option options[] = {
                 .flag = NULL,
                 .val = 'i'
         },
+       { /* sentinel */ }
 };
 
 static void dolog(const char *fmt, ...)