mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-15 06:50:32 +00:00
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:
parent
2160f185f1
commit
de111ea903
@ -240,22 +240,22 @@ static int zip_file_read(
|
|||||||
const char *needle, void **buf,
|
const char *needle, void **buf,
|
||||||
const char *optional_outfile)
|
const char *optional_outfile)
|
||||||
{
|
{
|
||||||
file_archive_transfer_t zlib;
|
file_archive_transfer_t zlib = {0};
|
||||||
struct archive_extract_userdata userdata = {{0}};
|
struct archive_extract_userdata userdata = {{0}};
|
||||||
bool returnerr = true;
|
bool returnerr = true;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
zlib.type = ARCHIVE_TRANSFER_INIT;
|
zlib.type = ARCHIVE_TRANSFER_INIT;
|
||||||
|
|
||||||
userdata.decomp_state.needle = NULL;
|
userdata.decomp_state.needle = NULL;
|
||||||
userdata.decomp_state.opt_file = NULL;
|
userdata.decomp_state.opt_file = NULL;
|
||||||
userdata.decomp_state.found = false;
|
userdata.decomp_state.found = false;
|
||||||
userdata.decomp_state.buf = buf;
|
userdata.decomp_state.buf = buf;
|
||||||
|
|
||||||
if (needle)
|
if (needle)
|
||||||
userdata.decomp_state.needle = strdup(needle);
|
userdata.decomp_state.needle = strdup(needle);
|
||||||
if (optional_outfile)
|
if (optional_outfile)
|
||||||
userdata.decomp_state.opt_file = strdup(optional_outfile);
|
userdata.decomp_state.opt_file = strdup(optional_outfile);
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user