From 09f88f1b2a48d18e3c59e04353fe86f62d28d5c3 Mon Sep 17 00:00:00 2001 From: zhaoshuang Date: Tue, 2 Sep 2025 14:43:24 +0800 Subject: [PATCH] fix null file pointer issue which leads to coredump (cherry picked from commit 23d23cf87511e5bf7af0eb9e7b99f8bb778a473a) --- fcitx.spec | 10 ++++++---- fix-null-file-pointer-issue.patch | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 fix-null-file-pointer-issue.patch diff --git a/fcitx.spec b/fcitx.spec index e30c619..fb998d0 100755 --- a/fcitx.spec +++ b/fcitx.spec @@ -5,7 +5,7 @@ Name: fcitx Summary: An input method framework Version: 4.2.9.7 -Release: 3 +Release: 4 License: GPLv2+ URL: https://fcitx-im.org/wiki/Fcitx Source0: http://download.fcitx-im.org/fcitx/%{name}-%{version}_dict.tar.xz @@ -20,6 +20,7 @@ Requires(postun): %{_sbindir}/alternatives Patch1: 0001-fix-fcitx-desktop-hide-fcitx-from-kiran-menu-of-Kira.patch Patch2: 0001-fix-nodisplay.patch +Patch3: fix-null-file-pointer-issue.patch %description Fcitx is an input method framework with extension support. Currently it @@ -47,9 +48,7 @@ developing programs using Fcitx libraries. %prep -%setup -q -%patch1 -p1 -%patch2 -p1 +%autosetup -p1 %build mkdir -p build @@ -197,6 +196,9 @@ fi %{_datadir}/gir-1.0/Fcitx-1.0.gir %changelog +* Tue Sep 02 2025 kkz - 4.2.9.7-4 +- fix null file pointer issue which leads to coredump + * Thu Dec 21 2023 liuzhilin - 4.2.9.7-3 - hide fcitx from DDE diff --git a/fix-null-file-pointer-issue.patch b/fix-null-file-pointer-issue.patch new file mode 100644 index 0000000..b7f3514 --- /dev/null +++ b/fix-null-file-pointer-issue.patch @@ -0,0 +1,25 @@ +From: zhaoshuang +Date: Tue, 2 Sep 2025 14:40:07 +0800 +Subject: [PATCH] fix null file pointer issue + +--- + src/im/pinyin/sp.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/im/pinyin/sp.c b/src/im/pinyin/sp.c +index 19af826..cddbc4e 100644 +--- a/src/im/pinyin/sp.c ++++ b/src/im/pinyin/sp.c +@@ -166,7 +166,8 @@ void LoadSPData(FcitxPinyinState *pystate) + } + } + +- fclose(fp); ++ if (fp) ++ fclose(fp); + } + break; + } +-- +2.43.0 + -- Gitee