Fix : Index crash when meet encrypt .doc files.

This commit is contained in:
iaom 2021-08-27 18:07:42 +08:00
parent d9ac480ae1
commit c877f83d4b
1 changed files with 6 additions and 0 deletions

View File

@ -4874,6 +4874,7 @@ bool KBinaryParser::read8DocText(FILE *pFile, const ppsInfoType *pPPS,
const ULONG *aulBlockDepot; const ULONG *aulBlockDepot;
ULONG ulTextOffset, ulBeginTextInfo; ULONG ulTextOffset, ulBeginTextInfo;
ULONG ulTotLength, ulLen; ULONG ulTotLength, ulLen;
ULONG ulEncryptInfo;
long lIndex, lPieces, lOff; long lIndex, lPieces, lOff;
size_t tTextInfoLen, tBlockDepotLen, tBlockSize; size_t tTextInfoLen, tBlockDepotLen, tBlockSize;
int iType, iLen; int iType, iLen;
@ -4882,6 +4883,11 @@ bool KBinaryParser::read8DocText(FILE *pFile, const ppsInfoType *pPPS,
ulBeginTextInfo = ulGetLong(0x1a2, aucHeader); /* fcClx */ ulBeginTextInfo = ulGetLong(0x1a2, aucHeader); /* fcClx */
tTextInfoLen = (size_t)ulGetLong(0x1a6, aucHeader); /* lcbClx */ 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) if(pPPS->tTable.ulSize == 0)
return false; return false;