1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-27 02:18:21 +00:00

Add tests for 32 bit build

This commit is contained in:
Jukka Ojanen 2021-09-02 15:57:22 +03:00
parent e6c89040fe
commit 592b28f65f

View File

@ -369,10 +369,7 @@ size_t hc_fread (void *ptr, size_t size, size_t nmemb, HCFILE *fp)
#ifndef _WIN64 #ifndef _WIN64
/* check 2 GB limit with 32 bit build */ /* check 2 GB limit with 32 bit build */
if (len >= INT32_MAX) if (len >= INT32_MAX) return n;
{
return n;
}
#endif #endif
if (len <= HCFILE_CHUNK_SIZE) if (len <= HCFILE_CHUNK_SIZE)
@ -414,6 +411,11 @@ size_t hc_fread (void *ptr, size_t size, size_t nmemb, HCFILE *fp)
u64 len = (u64) size * nmemb; u64 len = (u64) size * nmemb;
u64 pos = 0; u64 pos = 0;
#if defined(_WIN) && !defined(_WIN64)
/* check 2 GB limit with 32 bit build */
if (len >= INT32_MAX) return n;
#endif
/* assume success */ /* assume success */
n = nmemb; n = nmemb;
@ -440,6 +442,11 @@ size_t hc_fread (void *ptr, size_t size, size_t nmemb, HCFILE *fp)
SRes res = SZ_OK; SRes res = SZ_OK;
xzfile_t *xfp = fp->xfp; xzfile_t *xfp = fp->xfp;
#if defined(_WIN) && !defined(_WIN64)
/* check 2 GB limit with 32 bit build */
if (outLen >= INT32_MAX) return n;
#endif
/* assume success */ /* assume success */
n = nmemb; n = nmemb;