Should fix some zip archives potentially not working on Linux; the

stream member of zlib was being set to random memory, so it was
attempted
 to be freed on line 73 of trans_stream_zlib.c
This commit is contained in:
twinaphex 2018-04-25 10:10:22 +02:00
parent 2160f185f1
commit de111ea903

View File

@ -240,22 +240,22 @@ static int zip_file_read(
const char *needle, void **buf,
const char *optional_outfile)
{
file_archive_transfer_t zlib;
file_archive_transfer_t zlib = {0};
struct archive_extract_userdata userdata = {{0}};
bool returnerr = true;
int ret = 0;
bool returnerr = true;
int ret = 0;
zlib.type = ARCHIVE_TRANSFER_INIT;
zlib.type = ARCHIVE_TRANSFER_INIT;
userdata.decomp_state.needle = NULL;
userdata.decomp_state.opt_file = NULL;
userdata.decomp_state.found = false;
userdata.decomp_state.buf = buf;
userdata.decomp_state.needle = NULL;
userdata.decomp_state.opt_file = NULL;
userdata.decomp_state.found = false;
userdata.decomp_state.buf = buf;
if (needle)
userdata.decomp_state.needle = strdup(needle);
userdata.decomp_state.needle = strdup(needle);
if (optional_outfile)
userdata.decomp_state.opt_file = strdup(optional_outfile);
userdata.decomp_state.opt_file = strdup(optional_outfile);
do
{