From 6e054bf66112689306243a1eb6ef6ef45a49c6bd Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 3 Dec 2019 21:38:39 +0100 Subject: stp: exit(2) on unsupported positional arguments on command line Change-Id: I70390948943fe42469b8c6d63babc232e857e60c --- stp/stp_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stp/stp_main.c b/stp/stp_main.c index 3923ed2..19420c0 100644 --- a/stp/stp_main.c +++ b/stp/stp_main.c @@ -127,6 +127,11 @@ static void handle_options(int argc, char **argv) break; } } + + if (argc > optind) { + fprintf(stderr, "Unsupported positional arguments in command line\n"); + exit(2); + } } static void signal_handler(int signal) -- cgit v1.2.3