From a09cb22d8314f6cc4162c1f1413c2012166f91c0 Mon Sep 17 00:00:00 2001 From: liyuan Date: Mon, 6 Nov 2023 07:11:53 +0800 Subject: [PATCH] backport Fix segfautl by closing unopened file --- ...ix-segfautl-by-closing-unopened-file.patch | 25 +++++++++++++++++++ pinfo.spec | 6 ++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 0003-Fix-segfautl-by-closing-unopened-file.patch diff --git a/0003-Fix-segfautl-by-closing-unopened-file.patch b/0003-Fix-segfautl-by-closing-unopened-file.patch new file mode 100644 index 0000000..60d1701 --- /dev/null +++ b/0003-Fix-segfautl-by-closing-unopened-file.patch @@ -0,0 +1,25 @@ +From 97ed756e6220c8966d434cd225e8e904b62d0b92 Mon Sep 17 00:00:00 2001 +From: "bas@zoetekouw.net" +Date: Mon, 7 Aug 2017 23:02:16 +0200 +Subject: [PATCH] Fix segfautl by closing unopened file + +--- + src/filehandling_functions.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/filehandling_functions.c b/src/filehandling_functions.c +index 7df08fd..dd0866c 100644 +--- a/src/filehandling_functions.c ++++ b/src/filehandling_functions.c +@@ -211,7 +211,7 @@ dirpage_lookup(char **type, char ***message, long *lines, + } + + /* if we haven't found anything, clean up and exit */ +- if (!goodHit) ++ if (id && !goodHit) + { + fclose(id); + id = 0; +-- +2.33.0 + diff --git a/pinfo.spec b/pinfo.spec index 6344c77..419cbee 100644 --- a/pinfo.spec +++ b/pinfo.spec @@ -1,6 +1,6 @@ Name: pinfo Version: 0.6.10 -Release: 24 +Release: 25 Summary: An user-friendly, console-based viewer for Info documents License: GPLv2 URL: http://pinfo.alioth.debian.org @@ -13,6 +13,7 @@ Patch0005: pinfo-0.6.9-infopath.patch Patch0006: pinfo-0.6.10-man.patch Patch0007: 0001-Gracefully-handle-missing-indirect-info-nodes.patch Patch0008: 0002-Fix-infinite-loop-when-regexp-matching-an-empty-stri.patch +Patch0009: 0003-Fix-segfautl-by-closing-unopened-file.patch BuildRequires: ncurses-devel automake gettext-devel libtool texinfo Requires: xdg-utils @@ -54,6 +55,9 @@ Pinfo-help provides man pages and other related help documents for pinfo. %{_mandir}/man1/pinfo.1* %changelog +* Thu Nov 09 2023 liyuanyuan - 0.6.10-25 +- Fix segfautl by closing unopened file + * Fri Nov 03 2023 liyuanyuan - 0.6.10-24 - Fix infinite loop when regexp-matching an empty string