You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: The function mz_zip_extract_archive_file_to_heap() can fail to locate
an archive member, because it uses binary search in the central directory, even
if that central directory was never sorted because the
MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY flag was specified when initializing
the archive reader.
The problem is caused by the following two lines in mz_zip_reader_locate_file():
if (((flags & (MZ_ZIP_FLAG_IGNORE_PATH | MZ_ZIP_FLAG_CASE_SENSITIVE) == 0) && (!pComment) && (pZip->m_pState->m_sorted_central_dir_offsets.m_p))
return mz_zip_reader_locate_file_binary_search(pZip, pName);
The check whether pZip->m_pState->m_sorted_central_dir_offsets.m_p is
initialized is probably meant to determine whether the central directory was
sorted. However, the pZip->m_pState->m_sorted_central_dir_offsets array is
*always* initialized, irrespective of whether the central directory was sorted
or not (see the definition of mz_zip_reader_read_central_dir()).
Hence, a different way of checking whether the central directory has been
sorted should be implemented.
Original issue reported on code.google.com by jeremy.j...@gmail.com on 9 Sep 2013 at 1:45
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
jeremy.j...@gmail.com
on 9 Sep 2013 at 1:45The text was updated successfully, but these errors were encountered: