diff options
author | Harald Welte <laforge@osmocom.org> | 2019-12-03 21:49:06 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2019-12-03 21:49:31 +0100 |
commit | 2ca002f4af22aabbed89434440fc3443c8619295 (patch) | |
tree | d56b6d70aacd0935bd71e8166102ef89ed3fb8a7 /src/ipaccess | |
parent | a1d175ab664e210d9c4dfa89c374cd581d6bb0c1 (diff) |
exit(2) on unsupported positional arguments on command line
Change-Id: I3b8781e220326387f1c437c39aff8661326f1e0a
Diffstat (limited to 'src/ipaccess')
-rw-r--r-- | src/ipaccess/ipaccess-proxy.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c index 3d5f301d8..f4d620b34 100644 --- a/src/ipaccess/ipaccess-proxy.c +++ b/src/ipaccess/ipaccess-proxy.c @@ -1200,6 +1200,10 @@ static void handle_options(int argc, char** argv) break; } } + if (argc > optind) { + fprintf(stderr, "Unsupported positional arguments on command line\n"); + exit(2); + } if ((options_mask & (IPA_PROXY_OPT_LISTEN_IP | IPA_PROXY_OPT_BSC_IP)) != (IPA_PROXY_OPT_LISTEN_IP | IPA_PROXY_OPT_BSC_IP)) { printf("ERROR: You have to specify `--listen' and `--bsc' " |