dtls threaded examples: sanity check n_threads.

pull/419/head
jordan 2024-01-17 00:51:53 -06:00
parent 2fa54af672
commit fae5acd049
1 changed files with 5 additions and 0 deletions

View File

@ -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 */ /* Code for handling signals */
struct sigaction act, oact; struct sigaction act, oact;
act.sa_handler = sig_handler; act.sa_handler = sig_handler;