From: Daniel Stenberg Date: Fri, 9 Feb 2018 13:29:03 +0000 (+0100) Subject: get_posix_time: only check for overflows if they can happen! X-Git-Tag: curl-7_59_0~90 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=23722c515fc416ac4b024b49cba8758c329990cf;p=thirdparty%2Fcurl.git get_posix_time: only check for overflows if they can happen! --- diff --git a/lib/smb.c b/lib/smb.c index e5ac5d76a8..b4326341ea 100644 --- a/lib/smb.c +++ b/lib/smb.c @@ -716,11 +716,13 @@ static void get_posix_time(time_t *out, curl_off_t timestamp) { timestamp -= 116444736000000000; timestamp /= 10000000; +#if SIZEOF_TIME_T < SIZEOF_CURL_OFF_T if(timestamp > TIME_T_MAX) *out = TIME_T_MAX; else if(timestamp < TIME_T_MIN) *out = TIME_T_MIN; else +#endif *out = (time_t) timestamp; }