Skip to content

Commit fae5acd

Browse files
committed
dtls threaded examples: sanity check n_threads.
1 parent 2fa54af commit fae5acd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

dtls/server-dtls-threaded.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ main(int argc,
101101
}
102102
}
103103

104+
if (n_threads <= 0 || n_threads > DTLS_NUMTHREADS) {
105+
printf("error: invalid n_threads: %d\n", n_threads);
106+
return EXIT_FAILURE;
107+
}
108+
104109
/* Code for handling signals */
105110
struct sigaction act, oact;
106111
act.sa_handler = sig_handler;

0 commit comments

Comments
 (0)