From ebe045a83304bc1bed2eec064820d6a49b76110a Mon Sep 17 00:00:00 2001 From: Elena Subbotina Date: Fri, 17 May 2024 11:56:18 +0300 Subject: [PATCH] fix bug #67995 --- MsBinaryFile/Common/Vba/StreamObjects.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MsBinaryFile/Common/Vba/StreamObjects.cpp b/MsBinaryFile/Common/Vba/StreamObjects.cpp index 44badb466b..64ae0f1c4b 100644 --- a/MsBinaryFile/Common/Vba/StreamObjects.cpp +++ b/MsBinaryFile/Common/Vba/StreamObjects.cpp @@ -41,6 +41,8 @@ namespace VBA bool DirStreamObject::loadContent() { + if (!reader) return false; + InformationRecord = boost::make_shared(reader); ReferencesRecord = boost::make_shared(reader); ModulesRecord = boost::make_shared(reader); @@ -50,12 +52,16 @@ bool DirStreamObject::loadContent() bool ModuleStreamObject::loadContent() { - SourceCode = convert_string_icu((char*)reader->getData(), (unsigned int)reader->getDataSize(), reader->CodePage); + if (!reader) return false; + + SourceCode = convert_string_icu((char*)reader->getData(), (unsigned int)reader->getDataSize(), reader->CodePage); return true; } bool ProjectStreamObject::loadContent() { + if (!reader) return false; + std::string strProps((char*)reader->getData(), reader->getDataSize()); std::vector arrProps; @@ -72,6 +78,8 @@ bool ProjectStreamObject::loadContent() } bool VBFrameObject::loadContent() { + if (!reader) return false; + std::wstring strProps = convert_string_icu((char*)reader->getData(), (unsigned int)reader->getDataSize(), reader->CodePage); std::vector arrProps; @@ -94,6 +102,8 @@ bool VBFrameObject::loadContent() bool FormControlStream::loadContent() { + if (!reader) return false; + unsigned char MinorVersion, MajorVersion; _UINT16 cbForm;