From 303c1fee6c5992ead22e954a844e5929625d19b2 Mon Sep 17 00:00:00 2001 From: iaom <18504285112@163.com> Date: Mon, 19 Jul 2021 14:09:35 +0800 Subject: [PATCH] Update binary-parser.cpp. --- libsearch/parser/binary-parser.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libsearch/parser/binary-parser.cpp b/libsearch/parser/binary-parser.cpp index 968e066..59e9ef4 100644 --- a/libsearch/parser/binary-parser.cpp +++ b/libsearch/parser/binary-parser.cpp @@ -5205,8 +5205,10 @@ int KBinaryParser::InitDocOle(FILE* pFile, long lFilesize, QString &content) { for(iIndex = 0, ulTmp = ulSbdStartblock; iIndex < (int)tBBDLen && ulTmp != END_OF_CHAIN; iIndex++, ulTmp = aulBBD[ulTmp]) { - if(ulTmp >= (ULONG)tBBDLen) + if(ulTmp >= (ULONG)tBBDLen) { qWarning("The Big Block Depot is damaged"); + return -1; + } aulSbdList[iIndex] = ulTmp; } @@ -5349,7 +5351,10 @@ bool KBinaryParser::RunParser(QString strFile, QString &content) { (void)fclose(pFile); return false; } - InitDocOle(pFile, lFileSize, content); + // If InitDocOle failed, -1 will be returned. + if(InitDocOle(pFile, lFileSize, content)) { + qWarning() << "InitDocOle failed!" << strFile; + } fclose(pFile); return true; }