mirror of
https://github.com/libretro/RetroArch
synced 2025-02-26 06:40:39 +00:00
Fix transfer of control bypasses initialization of variables
This commit is contained in:
parent
8a4efb6189
commit
46a86f5eab
@ -86,6 +86,9 @@ end:
|
|||||||
|
|
||||||
bool zlib_extract_first_rom(char *zip_path, size_t zip_path_size, const char *valid_exts)
|
bool zlib_extract_first_rom(char *zip_path, size_t zip_path_size, const char *valid_exts)
|
||||||
{
|
{
|
||||||
|
const uint8_t *footer = NULL;
|
||||||
|
const uint8_t *directory = NULL;
|
||||||
|
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
if (!valid_exts)
|
if (!valid_exts)
|
||||||
{
|
{
|
||||||
@ -102,7 +105,7 @@ bool zlib_extract_first_rom(char *zip_path, size_t zip_path_size, const char *va
|
|||||||
if (zip_size < 22)
|
if (zip_size < 22)
|
||||||
GOTO_END_ERROR();
|
GOTO_END_ERROR();
|
||||||
|
|
||||||
const uint8_t *footer = data + zip_size - 22;
|
footer = data + zip_size - 22;
|
||||||
for (;; footer--)
|
for (;; footer--)
|
||||||
{
|
{
|
||||||
if (footer <= data + 22)
|
if (footer <= data + 22)
|
||||||
@ -115,7 +118,7 @@ bool zlib_extract_first_rom(char *zip_path, size_t zip_path_size, const char *va
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t *directory = data + read_le(footer + 16, 4);
|
directory = data + read_le(footer + 16, 4);
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user