summaryrefslogtreecommitdiff
path: root/thirdparty/minizip/ioapi.c
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-03-31 14:14:05 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-03-31 15:19:11 +0200
commit420d0d50bcdc47c793157c2f1e143136eafa6500 (patch)
tree375213d3f3b14f97cb4dd8c8d9ccb4e54ca80105 /thirdparty/minizip/ioapi.c
parenta647fb3e623c8e5c14427c2631ee61f132951709 (diff)
zlib/minizip: Update to version 1.2.12
Security update, fixes CVE-2018-25032 in zlib. Preliminary assessment doesn't show Godot as affected since we don't seem to call `deflate` with the problematic parameters, but the extent of the vulnerability is not fully clear upstream yet.
Diffstat (limited to 'thirdparty/minizip/ioapi.c')
-rw-r--r--thirdparty/minizip/ioapi.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/thirdparty/minizip/ioapi.c b/thirdparty/minizip/ioapi.c
index 9cb27c16db..db4c33b4b9 100644
--- a/thirdparty/minizip/ioapi.c
+++ b/thirdparty/minizip/ioapi.c
@@ -58,7 +58,7 @@ ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream
return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream);
else
{
- uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
+ uLong tell_uLong = (uLong)(*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
if ((tell_uLong) == MAXU32)
return (ZPOS64_T)-1;
else
@@ -101,6 +101,7 @@ static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
{
+ (void)opaque;
FILE* file = NULL;
const char* mode_fopen = NULL;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
@@ -119,6 +120,7 @@ static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, in
static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
{
+ (void)opaque;
FILE* file = NULL;
const char* mode_fopen = NULL;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
@@ -138,6 +140,7 @@ static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename,
static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
{
+ (void)opaque;
uLong ret;
ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
return ret;
@@ -145,6 +148,7 @@ static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf,
static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
{
+ (void)opaque;
uLong ret;
ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
return ret;
@@ -152,6 +156,7 @@ static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const voi
static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
{
+ (void)opaque;
long ret;
ret = ftell((FILE *)stream);
return ret;
@@ -160,13 +165,15 @@ static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
{
+ (void)opaque;
ZPOS64_T ret;
- ret = FTELLO_FUNC((FILE *)stream);
+ ret = (ZPOS64_T)FTELLO_FUNC((FILE *)stream);
return ret;
}
static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin)
{
+ (void)opaque;
int fseek_origin=0;
long ret;
switch (origin)
@@ -183,13 +190,14 @@ static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offs
default: return -1;
}
ret = 0;
- if (fseek((FILE *)stream, offset, fseek_origin) != 0)
+ if (fseek((FILE *)stream, (long)offset, fseek_origin) != 0)
ret = -1;
return ret;
}
static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)
{
+ (void)opaque;
int fseek_origin=0;
long ret;
switch (origin)
@@ -207,7 +215,7 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T
}
ret = 0;
- if(FSEEKO_FUNC((FILE *)stream, offset, fseek_origin) != 0)
+ if(FSEEKO_FUNC((FILE *)stream, (long)offset, fseek_origin) != 0)
ret = -1;
return ret;
@@ -216,6 +224,7 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T
static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
{
+ (void)opaque;
int ret;
ret = fclose((FILE *)stream);
return ret;
@@ -223,6 +232,7 @@ static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
{
+ (void)opaque;
int ret;
ret = ferror((FILE *)stream);
return ret;