From dd741b8893f28ec75fae9648c9e26c2fc887a781 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 25 Oct 2023 19:25:38 +0200 Subject: [PATCH] random-seed: terminate the option array So we don't crash on invalid options: $ build/systemd-random-seed --foo Segmentation fault (core dumped) --- src/random-seed/random-seed.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/random-seed/random-seed.c b/src/random-seed/random-seed.c index 25d4d3f584..12eb1f7eac 100644 --- a/src/random-seed/random-seed.c +++ b/src/random-seed/random-seed.c @@ -348,6 +348,7 @@ static int parse_argv(int argc, char *argv[]) { static const struct option options[] = { { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, ARG_VERSION }, + {} }; int c;