From 3bbce36f0f3db9ac6179e783d4bfe755f51928eb Mon Sep 17 00:00:00 2001 From: ElenaSubbotina Date: Tue, 8 Dec 2020 19:41:54 +0300 Subject: [PATCH] x2t - fix bug #47775 --- Common/OfficeFileFormatChecker2.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Common/OfficeFileFormatChecker2.cpp b/Common/OfficeFileFormatChecker2.cpp index ce23347d13..be195fef05 100644 --- a/Common/OfficeFileFormatChecker2.cpp +++ b/Common/OfficeFileFormatChecker2.cpp @@ -751,11 +751,12 @@ bool COfficeFileFormatChecker::isOpenOfficeFlatFormatFile(unsigned char* pBuffer { if (dwBytes < 78) return false; - const char *odfFormatLine = "office:document xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\""; - + const char *odfFormatLine1 = "office:document"; + const char *odfFormatLine2 = "xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\""; + std::string xml_string((char*)pBuffer, dwBytes); - if (std::string::npos == xml_string.find(odfFormatLine)) + if ((std::string::npos == xml_string.find(odfFormatLine1)) || (std::string::npos == xml_string.find(odfFormatLine2))) { return false; }