diff options
author | Daniel Stenberg <daniel@haxx.se> | 2018-03-20 15:15:14 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-03-20 19:25:50 +0100 |
commit | c1366571b609407cf0d4d9f4a2769d29e1313151 (patch) | |
tree | 38d0ac65b3a1303b97b9065aca308d44c3f4dbfa /lib/curl_ntlm_core.c | |
parent | f623ad65e81c76f34130be272a4efe1d1abe1e13 (diff) |
vauth/cleartext: fix integer overflow check
Make the integer overflow check not rely on the undefined behavior that
a size_t wraps around on overflow.
Detected by lgtm.com
Closes #2408
Diffstat (limited to 'lib/curl_ntlm_core.c')
-rw-r--r-- | lib/curl_ntlm_core.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index e8962769c..72eda34ad 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -646,15 +646,6 @@ CURLcode Curl_hmac_md5(const unsigned char *key, unsigned int keylen, return CURLE_OK; } -#ifndef SIZE_T_MAX -/* some limits.h headers have this defined, some don't */ -#if defined(SIZEOF_SIZE_T) && (SIZEOF_SIZE_T > 4) -#define SIZE_T_MAX 18446744073709551615U -#else -#define SIZE_T_MAX 4294967295U -#endif -#endif - /* This creates the NTLMv2 hash by using NTLM hash as the key and Unicode * (uppercase UserName + Domain) as the data */ |