From fc55c723c4ecebabf12c32caddd0f9bc9d169ed4 Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Wed, 27 May 2020 17:24:21 +0200 Subject: select: add overflow checks for timeval conversions Using time_t and suseconds_t if suseconds_t is available, long on Windows (maybe others in the future) and int elsewhere. Also handle case of ULONG_MAX being greater or equal to INFINITE. Assisted-by: Jay Satiro Reviewed-by: Daniel Stenberg Part of #5343 --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 8161eee94..949ce12c0 100755 --- a/configure.ac +++ b/configure.ac @@ -4064,6 +4064,19 @@ AC_CHECK_TYPE(sa_family_t, #endif ]) +# check for suseconds_t +AC_CHECK_TYPE([suseconds_t],[ + AC_DEFINE(HAVE_SUSECONDS_T, 1, + [Define to 1 if suseconds_t is an available type.]) +], ,[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +]) + AC_MSG_CHECKING([if time_t is unsigned]) CURL_RUN_IFELSE( [ -- cgit v1.2.3