x2t - fix bug #47775

This commit is contained in:
ElenaSubbotina
2020-12-08 19:41:54 +03:00
parent 5f75c1ac90
commit 3bbce36f0f

View File

@ -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;
}