From 5e5fb5ea6dcd60a7a14bc5b2b7585c72855a922c Mon Sep 17 00:00:00 2001 From: "Elena.Subbotina" Date: Sat, 22 Jul 2023 19:16:59 +0300 Subject: [PATCH] fix bug #63443 --- OfficeCryptReader/source/ECMACryptFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OfficeCryptReader/source/ECMACryptFile.cpp b/OfficeCryptReader/source/ECMACryptFile.cpp index 8f5384d171..60a6e430eb 100644 --- a/OfficeCryptReader/source/ECMACryptFile.cpp +++ b/OfficeCryptReader/source/ECMACryptFile.cpp @@ -1095,7 +1095,7 @@ bool ECMACryptFile::DecryptOfficeFile(const std::wstring &file_name_inp, const s { NSFile::CFileBinary f; f.CreateFileW(file_name_out); - f.WriteFile(data_out, lengthData); + f.WriteFile(data_out, (std::min)((int)lengthData, readData)); f.CloseFile(); delete []data_out;