diff options
author | Mack <86566939+Macksaur@users.noreply.github.com> | 2022-12-06 17:40:46 +0000 |
---|---|---|
committer | Mack <86566939+Macksaur@users.noreply.github.com> | 2023-05-31 13:11:59 +0000 |
commit | 1326b7e04f6592195d3bc377ec602fd2e120a336 (patch) | |
tree | 63183cdd45397def7a7e3803820a81babf50dbf5 /core/io/zip_io.h | |
parent | 83d5cbf519c3864fe793a84ed6ae0f74a0f91660 (diff) | |
download | redot-engine-1326b7e04f6592195d3bc377ec602fd2e120a336.tar.gz |
Fix buffer over-read and memory leaks when using long filepaths in a zip archive and improved robustness of long filepaths and reading files.
Diffstat (limited to 'core/io/zip_io.h')
-rw-r--r-- | core/io/zip_io.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/io/zip_io.h b/core/io/zip_io.h index 094d490bcf..c59b981373 100644 --- a/core/io/zip_io.h +++ b/core/io/zip_io.h @@ -39,6 +39,13 @@ #include "thirdparty/minizip/unzip.h" #include "thirdparty/minizip/zip.h" +// Get the current file info and safely convert the full filepath to a String. +int godot_unzip_get_current_file_info(unzFile p_zip_file, unz_file_info64 &r_file_info, String &r_filepath); +// Try to locate the file in the archive specified by the filepath (works with large paths and Unicode). +int godot_unzip_locate_file(unzFile p_zip_file, String p_filepath, bool p_case_sensitive = true); + +// + void *zipio_open(voidpf opaque, const char *p_fname, int mode); uLong zipio_read(voidpf opaque, voidpf stream, void *buf, uLong size); uLong zipio_write(voidpf opaque, voidpf stream, const void *buf, uLong size); |