Skip to content

Commit 4a6a782

Browse files
committed
dtls-server.c: check for left cli-arguments.
Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
1 parent 802e137 commit 4a6a782

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/dtls-server.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ usage(const char *program, const char *version) {
308308
program = ++p;
309309

310310
fprintf(stderr, "%s v%s -- DTLS server implementation\n"
311-
"(c) 2011-2014 Olaf Bergmann <bergmann@tzi.org>\n\n"
311+
"(c) 2011-2024 Olaf Bergmann <bergmann@tzi.org>\n\n"
312312
"usage: %s [-A address] [-c cipher suites] [-e] [-p port] [-r] [-v num]\n"
313313
"\t-A address\t\tlisten on specified address (default is ::)\n",
314314
program, version, program);
@@ -386,6 +386,11 @@ main(int argc, char **argv) {
386386
exit(1);
387387
}
388388
}
389+
if (argc != optind) {
390+
dtls_warn("no arguments supported!\n");
391+
usage(argv[0], dtls_package_version());
392+
exit(1);
393+
}
389394
listen_addr.sin6_port = port;
390395

391396
dtls_set_log_level(log_level);

0 commit comments

Comments
 (0)