Merged
Conversation
Add zip extraction module using minizip/zlib. After downloading a ROM whose fs_name ends in .zip, automatically extract all files to the same directory with an Extracting... progress bar, then delete the zip file. Update the file-exists check so that for zip ROMs, it scans the target directory for any file matching the stem (filename without .zip extension) rather than requiring an exact match. Generalize ui_draw_download_progress to ui_draw_progress with a configurable label parameter.
- Reject zip entries containing '..' to prevent path traversal (Zip Slip) - Remove partial files on extraction failure or cancellation - Clean up zip file when extraction fails in both download paths
Merge download_progress and extract_progress into a single progress_callback that uses a static progressLabel string. Simplify extract_if_zip to derive the destination directory from the zip path instead of requiring callers to build it.
- Comment the progressLabel/downloadName globals to explain the set-before-use pattern for progress callbacks - Add path length validation in zip_extract to skip entries that would overflow the destination path buffer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add zip extraction module using minizip/zlib. After downloading a ROM whose fs_name ends in .zip, automatically extract all files to the same directory with an Extracting... progress bar, then delete the zip file.
Update the file-exists check so that for zip ROMs, it scans the target directory for any file matching the stem (filename without .zip extension) rather than requiring an exact match.
Generalize ui_draw_download_progress to ui_draw_progress with a configurable label parameter.