From fae5acd049d4351f622fd234afb9522630985a1f Mon Sep 17 00:00:00 2001 From: jordan Date: Wed, 17 Jan 2024 00:51:53 -0600 Subject: [PATCH] dtls threaded examples: sanity check n_threads. --- dtls/server-dtls-threaded.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dtls/server-dtls-threaded.c b/dtls/server-dtls-threaded.c index 64a0bef0..2802959f 100644 --- a/dtls/server-dtls-threaded.c +++ b/dtls/server-dtls-threaded.c @@ -101,6 +101,11 @@ main(int argc, } } + if (n_threads <= 0 || n_threads > DTLS_NUMTHREADS) { + printf("error: invalid n_threads: %d\n", n_threads); + return EXIT_FAILURE; + } + /* Code for handling signals */ struct sigaction act, oact; act.sa_handler = sig_handler;