From 61c7e58b701e1e1803d8e6ae14ece9946324713b Mon Sep 17 00:00:00 2001 From: tanyulong2021 Date: Fri, 29 Oct 2021 14:48:58 +0800 Subject: [PATCH] fix Index crash when meet encrypt .doc files --- ...ex-crash-when-meet-encrypt-doc-files.patch | 37 +++++++++++++++++++ ukui-search.spec | 7 +++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 0002-fix-Index-crash-when-meet-encrypt-doc-files.patch diff --git a/0002-fix-Index-crash-when-meet-encrypt-doc-files.patch b/0002-fix-Index-crash-when-meet-encrypt-doc-files.patch new file mode 100644 index 0000000..4679fca --- /dev/null +++ b/0002-fix-Index-crash-when-meet-encrypt-doc-files.patch @@ -0,0 +1,37 @@ +From b537d67f758a349b26afb15c1fba4aaa472a2186 Mon Sep 17 00:00:00 2001 +From: tanyulong +Date: Fri, 29 Oct 2021 14:44:36 +0800 +Subject: [PATCH] fix Index crash when meet encrypt doc files + +--- + libsearch/parser/binary-parser.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/libsearch/parser/binary-parser.cpp b/libsearch/parser/binary-parser.cpp +index 59e9ef4..e45ca67 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; +@@ -4883,6 +4884,12 @@ 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; + +-- +2.30.0 + diff --git a/ukui-search.spec b/ukui-search.spec index 6dd7369..88cb633 100644 --- a/ukui-search.spec +++ b/ukui-search.spec @@ -2,13 +2,14 @@ Name: ukui-search Version: 0.4.1 -Release: 2 +Release: 3 Summary: Advanced ukui menu License: GPL-3.0 URL: http://www.ukui.org Source0: %{name}-%{version}.tar.gz Patch0: 0001-Update-changelog.patch +Patch1: 0002-fix-Index-crash-when-meet-encrypt-doc-files.patch BuildRequires: pkgconf BuildRequires: gsettings-qt-devel @@ -84,6 +85,7 @@ permanent. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build mkdir build && cd build @@ -135,6 +137,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Oct 29 2021 tanyulong - 0.4.1-3 +- fix Index crash when meet encrypt doc files + * Wed Oct 27 2021 tanyulong - 0.4.1-2 - Update changelog