From c877f83d4bd8ca216fc9495e182771efc7f81ef3 Mon Sep 17 00:00:00 2001 From: iaom <18504285112@163.com> Date: Fri, 27 Aug 2021 18:07:42 +0800 Subject: [PATCH] Fix : Index crash when meet encrypt .doc files. --- libsearch/parser/binary-parser.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libsearch/parser/binary-parser.cpp b/libsearch/parser/binary-parser.cpp index 59e9ef4..040a2cb 100644 --- a/libsearch/parser/binary-parser.cpp +++ b/libsearch/parser/binary-parser.cpp @@ -4874,6 +4874,7 @@ bool KBinaryParser::read8DocText(FILE *pFile, const ppsInfoType *pPPS, const ULONG *aulBlockDepot; ULONG ulTextOffset, ulBeginTextInfo; ULONG ulTotLength, ulLen; + ULONG ulEncryptInfo; long lIndex, lPieces, lOff; size_t tTextInfoLen, tBlockDepotLen, tBlockSize; int iType, iLen; @@ -4882,6 +4883,11 @@ bool KBinaryParser::read8DocText(FILE *pFile, const ppsInfoType *pPPS, ulBeginTextInfo = ulGetLong(0x1a2, aucHeader); /* fcClx */ tTextInfoLen = (size_t)ulGetLong(0x1a6, aucHeader); /* lcbClx */ + ulEncryptInfo = ulGetLong(0x0a, aucHeader); + if(ulEncryptInfo & 0x0100) { + qDebug() << "Encrypt file:" << m_strFileName << (size_t)ulEncryptInfo; + return false; + } if(pPPS->tTable.ulSize == 0) return false;