From: Pali Rohár Date: Tue, 21 Dec 2021 15:00:58 +0000 (+0100) Subject: pppoe-discovery: Add check that there is no additional extra argument X-Git-Tag: ppp-2.5.0~46^2~1 X-Git-Url: http://git.ozlabs.org/?a=commitdiff_plain;h=c2186b5bccdb4b8a38ae7956f1557e39ca4a4d9d;p=ppp.git pppoe-discovery: Add check that there is no additional extra argument Signed-off-by: Pali Rohár --- 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);