Round up nano secs when converting OSSL_TIME to struct timeval
authorMatt Caswell <matt@openssl.org>
Thu, 19 Oct 2023 10:00:39 +0000 (11:00 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 20 Oct 2023 15:33:40 +0000 (16:33 +0100)
commitc239bc9e960b866093dbc666c78c78935233750c
tree91963d43e3cf2f9d5ccdecaeb39e9c39aaf8e7a3
parent055f3dd140f124df6f2d8f3f910f00928224b04f
Round up nano secs when converting OSSL_TIME to struct timeval

struct timeval doesn't support nanosecs but OSSL_TIME does. We round up
any nanosecs to ensure that a non-zero input always results in a non-zero
output.

This fixes a quic-client fuzzer hang.

Fixes #22437

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22440)
include/internal/time.h