From 50d39771c0d72434685833b698258e48d6bce67f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 23 Oct 2017 11:56:39 +0300 Subject: [PATCH] Fixed out of bound read in zip file loader --- src/resourcefiles/file_zip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resourcefiles/file_zip.cpp b/src/resourcefiles/file_zip.cpp index 1245cfabe..02e350998 100644 --- a/src/resourcefiles/file_zip.cpp +++ b/src/resourcefiles/file_zip.cpp @@ -312,7 +312,7 @@ bool FZipFile::Open(bool quiet) } // skip Directories - if (name[len - 1] == '/' && LittleLong(zip_fh->UncompressedSize) == 0) + if (name.IsEmpty() || (name.Back() == '/' && LittleLong(zip_fh->UncompressedSize) == 0)) { skipped++; continue;