aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2020-05-27 17:24:21 +0200
committerMarc Hoersken <info@marc-hoersken.de>2020-05-30 10:21:23 +0200
commitfc55c723c4ecebabf12c32caddd0f9bc9d169ed4 (patch)
tree59ff19e138f87698427861ca41bfe02b010dd3f5 /configure.ac
parent4a8f459837e2b7dc146825fc9a864045f7d1ae4a (diff)
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
Diffstat (limited to 'configure.ac')
-rwxr-xr-xconfigure.ac13
1 files changed, 13 insertions, 0 deletions
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 <sys/types.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+])
+
AC_MSG_CHECKING([if time_t is unsigned])
CURL_RUN_IFELSE(
[