!29 backport Fix possible out-of-buffer write

From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
This commit is contained in:
openeuler-ci-bot 2023-12-25 06:52:40 +00:00 committed by Gitee
commit 19ebf9a8fd
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From df3b9600a16061a7661a58ba2750228b07825486 Mon Sep 17 00:00:00 2001
From: "bas@zoetekouw.net" <bas@zoetekouw.net>
Date: Wed, 9 Aug 2017 12:22:24 +0200
Subject: [PATCH] Fix possible out-of-buffer write
---
src/manual.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/manual.c b/src/manual.c
index 09b77f7..431dd66 100644
--- a/src/manual.c
+++ b/src/manual.c
@@ -211,9 +211,8 @@ construct_manualname(char *buf, int which)
ptr++;
strcpy(buf, ptr);
tmppos = strlen(buf);
- /* TODO: check the following statement */
- if (tmppos > 1);
- buf[tmppos - 2] = 0;
+ if (tmppos > 1)
+ buf[tmppos - 2] = 0;
strcat(buf, manuallinks[which].name);
xfree(base);
}
--
2.33.0

View File

@ -1,6 +1,6 @@
Name: pinfo
Version: 0.6.10
Release: 26
Release: 27
Summary: An user-friendly, console-based viewer for Info documents
License: GPLv2
URL: http://pinfo.alioth.debian.org
@ -15,6 +15,7 @@ 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
Patch0010: 0004-Fix-link-order-in-ncurses-autoconf-test.patch
Patch0011: 0005-Fix-possible-out-of-buffer-write.patch
BuildRequires: ncurses-devel automake gettext-devel libtool texinfo
Requires: xdg-utils
@ -56,6 +57,9 @@ Pinfo-help provides man pages and other related help documents for pinfo.
%{_mandir}/man1/pinfo.1*
%changelog
* Tue Dec 12 2023 liyuanyuan <liyuanyuan@xfusion.com> - 0.6.10-27
- Fix possible out-of-buffer write
* Fri Nov 24 2023 liyuanyuan <liyuanyuan@xfusion.com> - 0.6.10-26
- Fix link order in ncurses autoconf test