diff options
author | Andrea Grandi <andrea.grandi@intel.com> | 2016-03-25 04:19:30 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-04-06 09:09:51 +0100 |
commit | 570c0716e30ca3490cc8f5d8d7cf25bcd99d6c7c (patch) | |
tree | 2dd9185b295eb21fec08fc4eba9775d7ba15e0e7 /apps/speed.c | |
parent | 69853045e1154236d440eba363a001033f5e3781 (diff) | |
download | openssl-570c0716e30ca3490cc8f5d8d7cf25bcd99d6c7c.tar.gz |
Add a check of the FD_SETSIZE before the call to select()
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'apps/speed.c')
-rw-r--r-- | apps/speed.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/speed.c b/apps/speed.c index 409f3a98e2..b3f477e175 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -1174,6 +1174,16 @@ static int run_benchmark(int async_jobs, int (*loop_function)(void *), loopargs_ max_fd = job_fd; } + if (max_fd >= FD_SETSIZE) { + BIO_printf(bio_err, + "Error: max_fd (%d) must be smaller than FD_SETSIZE (%d). " + "Decrease the value of async_jobs\n", + max_fd, FD_SETSIZE); + ERR_print_errors(bio_err); + error = 1; + break; + } + select_result = select(max_fd + 1, &waitfdset, NULL, NULL, NULL); if (select_result == -1 && errno == EINTR) continue; |