From c2186b5bccdb4b8a38ae7956f1557e39ca4a4d9d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Tue, 21 Dec 2021 16:00:58 +0100 Subject: [PATCH] pppoe-discovery: Add check that there is no additional extra argument MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Pali Rohár --- pppd/plugins/pppoe/pppoe-discovery.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pppd/plugins/pppoe/pppoe-discovery.c b/pppd/plugins/pppoe/pppoe-discovery.c index 4ac5106..e93d781 100644 --- a/pppd/plugins/pppoe/pppoe-discovery.c +++ b/pppd/plugins/pppoe/pppoe-discovery.c @@ -251,6 +251,12 @@ int main(int argc, char *argv[]) } } + if (optind != argc) { + fprintf(stderr, "%s: extra argument '%s'\n", argv[0], argv[optind]); + usage(); + exit(EXIT_FAILURE); + } + if (!conn->ifName) { fprintf(stderr, "Interface was not specified\n"); exit(EXIT_FAILURE); -- 2.39.2