!23 backport Fix segfautl by closing unopened file

From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
This commit is contained in:
openeuler-ci-bot 2023-11-10 09:12:56 +00:00 committed by Gitee
commit 56dc69185a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,25 @@
From 97ed756e6220c8966d434cd225e8e904b62d0b92 Mon Sep 17 00:00:00 2001
From: "bas@zoetekouw.net" <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

View File

@ -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 <liyuanyuan@xfusion.com> - 0.6.10-25
- Fix segfautl by closing unopened file
* Fri Nov 03 2023 liyuanyuan <liyuanyuan@xfusion.com> - 0.6.10-24
- Fix infinite loop when regexp-matching an empty string