From de67c001b78dfc08e8baa4b8e0ab7fe9ca1170b7 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 3 Dec 2019 22:28:19 +0100 Subject: exit(2) on unsupported positional arguments on command line Change-Id: I4f2d70d0b0f1b7bdb8604c930aba8fbb53d8bd54 --- src/gtphub/gtphub_main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gtphub') diff --git a/src/gtphub/gtphub_main.c b/src/gtphub/gtphub_main.c index f693f0993..664c801e8 100644 --- a/src/gtphub/gtphub_main.c +++ b/src/gtphub/gtphub_main.c @@ -322,6 +322,11 @@ static void handle_options(struct cmdline_cfg *ccfg, int argc, char **argv) break; } } + + if (argc > optind) { + fprintf(stderr, "Unsupported positional arguments on command line\n"); + exit(2); + } } int main(int argc, char **argv) -- cgit v1.2.3