return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode);
else
{
+ if (pfilefunc->zopen32_file == NULL)
+ return NULL;
return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode);
}
}
else
{
uLong offsetTruncated = (uLong)offset;
- if (offsetTruncated != offset)
+ if (offsetTruncated != offset || pfilefunc->zseek32_file == NULL)
return -1;
else
return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin);
return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream);
else
{
+ if (pfilefunc->ztell32_file == NULL)
+ return (ZPOS64_T)-1;
uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
if ((tell_uLong) == ((uLong)-1))
return (ZPOS64_T)-1;
((argv[i][1]>='0') || (argv[i][1]<='9'))) &&
(strlen(argv[i]) == 2)))
{
- FILE * fin;
+ FILE * fin = NULL;
int size_read;
const char* filenameinzip = argv[i];
const char *savefilenameinzip;
if (fpZip != NULL && fpOut != NULL) {
int entries = 0;
uLong totalBytes = 0;
- char header[30];
+ char header[30] = {0,};
char filename[256];
char extra[1024];
int offset = 0;
zlib_filefunc64_32_def* pzlib_filefunc64_32_def,
int is64bitOpenFunction)
{
- unz64_s us;
- unz64_s *s;
+ unz64_s us = {0, };
+ unz64_s *s = NULL;
ZPOS64_T central_pos;
uLong uL;
{
zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;
zlib_filefunc64_32_def_fill.zfile_func64 = *pzlib_filefunc_def;
+ zlib_filefunc64_32_def_fill.zopen32_file = NULL;
zlib_filefunc64_32_def_fill.ztell32_file = NULL;
zlib_filefunc64_32_def_fill.zseek32_file = NULL;
return unzOpenInternal(path, &zlib_filefunc64_32_def_fill, 1);
{
zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;
zlib_filefunc64_32_def_fill.zfile_func64 = *pzlib_filefunc_def;
+ zlib_filefunc64_32_def_fill.zopen32_file = NULL;
zlib_filefunc64_32_def_fill.ztell32_file = NULL;
zlib_filefunc64_32_def_fill.zseek32_file = NULL;
return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill);