diff options
author | Darren Tucker <dtucker@dtucker.net> | 2021-07-12 10:00:05 +0200 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2021-07-12 10:21:26 +0200 |
commit | f5fc6a4c3404bbf65c21ca6361853b33d78aa87e (patch) | |
tree | 44eeb4c81e03705618760e91840e77b5b117ae9f /defines.h | |
parent | upstream: Make limit for time_t test unconditional in the (diff) | |
download | openssh-f5fc6a4c3404bbf65c21ca6361853b33d78aa87e.tar.xz openssh-f5fc6a4c3404bbf65c21ca6361853b33d78aa87e.zip |
Add configure-time detection for SSH_TIME_T_MAX.
Should fix printing cert times exceeding INT_MAX (bz#3329) on platforms
were time_t is a long long. The limit used is for the signed type, so if
some system has a 32bit unsigned time_t then the lower limit will still
be imposed and we would need to add some way to detect this. Anyone using
an unsigned 64bit can let us know when it starts being a problem.
Diffstat (limited to 'defines.h')
-rw-r--r-- | defines.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -304,6 +304,12 @@ typedef long long intmax_t; typedef unsigned long long uintmax_t; #endif +#if SIZEOF_TIME_T == SIZEOF_LONG_LONG_INT +# define SSH_TIME_T_MAX LLONG_MAX +#else +# define SSH_TIME_T_MAX INT_MAX +#endif + #ifndef HAVE_U_CHAR typedef unsigned char u_char; # define HAVE_U_CHAR |