Compare commits

...

11 Commits

Author SHA1 Message Date
openeuler-ci-bot
b92b7ff40d
!35 backport Fix possible buffer overrun
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-12-29 03:24:34 +00:00
openeuler-ci-bot
19ebf9a8fd
!29 backport Fix possible out-of-buffer write
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-12-25 06:52:40 +00:00
liyuan
e376c25d59 backport Fix possible buffer overrun 2023-12-22 02:10:51 +08:00
liyuan
e89ec36534 backport Fix possible out-of-buffer write 2023-12-21 22:00:36 +08:00
openeuler-ci-bot
df1da41a35
!27 Fix link order in ncurses autoconf test
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-11-24 09:23:23 +00:00
openeuler-ci-bot
56dc69185a
!23 backport Fix segfautl by closing unopened file
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-11-10 09:12:56 +00:00
liyuan
b248b1ce7e Fix link order in ncurses autoconf test
Thanks to Steve McIntyre for the patch (https://bugs.debian.org/646486)
2023-11-07 00:13:52 +08:00
liyuan
a09cb22d83 backport Fix segfautl by closing unopened file 2023-11-06 08:26:29 +08:00
openeuler-ci-bot
999bb09b51
!19 backport Fix infinite loop when regexp-matching an empty string
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-11-03 03:13:09 +00:00
liyuan
658243be8b backport Fix infinite loop when regexp-matching an empty string 2023-11-02 20:05:24 +08:00
openeuler-ci-bot
61ec0bb804
!15 backport Gracefully handle missing indirect info nodes
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-10-27 02:06:44 +00:00
6 changed files with 178 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From 751fa603d386915cf1114c937892bd30e86ea687 Mon Sep 17 00:00:00 2001
From: Bas Zoetekouw <bas@zoetekouw.net>
Date: Sat, 27 Dec 2014 19:03:50 +0100
Subject: [PATCH] Fix infinite loop when regexp-matching an empty string See
Debian bug https://bugs.debian.org/358389
---
src/video.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/video.c b/src/video.c
index cfcd417..52a3615 100644
--- a/src/video.c
+++ b/src/video.c
@@ -293,6 +293,20 @@ info_add_highlights(int pos, int cursor, long lines, int column, char **message)
/* yes, found something, so highlight it */
int n = pmatch[0].rm_eo - pmatch[0].rm_so;
+ if (n==0) { /* matched empty string! */
+ /* display error message */
+ char msg[81];
+ snprintf(msg, 81, "%s",
+ _("Warning: matched empty string") );
+ attrset(bottomline);
+ mvhline(maxy - 1, 0, ' ', maxx);
+ mvaddstr(maxy - 1, 0, msg);
+ move(0, 0);
+ attrset(normal);
+
+ break;
+ }
+
/* point str at start of match */
str += pmatch[0].rm_so;
--
2.33.0

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

@ -0,0 +1,41 @@
From d2633be28487f7b9adf1cce612ca781b236f2700 Mon Sep 17 00:00:00 2001
From: "bas@zoetekouw.net" <bas@zoetekouw.net>
Date: Tue, 8 Aug 2017 19:25:34 +0200
Subject: [PATCH] Fix link order in ncurses autoconf test Thanks to Steve
McIntyre for the patch (https://bugs.debian.org/646486)
---
macros/curses.m4 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/macros/curses.m4 b/macros/curses.m4
index b42fe7c..415eecf 100644
--- a/macros/curses.m4
+++ b/macros/curses.m4
@@ -254,11 +254,11 @@ dnl check if the curses header we found, works
dnl
AC_DEFUN([AC_CHECK_CURSES_COMPILE], [
- dnl save CFLAGS and LDFLAGS and set new ones
+ dnl save CFLAGS and LIBS and set new ones
CFLAGS_OLD=$CFLAGS
CFLAGS="$CFLAGS $curses_includes"
- LDFLAGS_OLD=$LDFLAGS
- LDFLAGS="$LDFLAGS $curses_libs"
+ LIBS_OLD=$LIBS
+ LIBS="$LIBS $curses_libs"
dnl do the compile test
AC_MSG_CHECKING([if curses is usable])
@@ -288,7 +288,7 @@ AC_DEFUN([AC_CHECK_CURSES_COMPILE], [
dnl restore variables
CFLAGS=$CFLAGS_OLD
- LDFLAGS=$LDFLAGS_OLD
+ LIBS=$LIBS_OLD
])
--
2.33.0

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

@ -0,0 +1,25 @@
From ca3ab82e4e203f47f83a8bac79b6275bd8521f1d Mon Sep 17 00:00:00 2001
From: "bas@zoetekouw.net" <bas@zoetekouw.net>
Date: Wed, 9 Aug 2017 12:22:39 +0200
Subject: [PATCH] Fix possible buffer overrun
---
src/manual.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/manual.c b/src/manual.c
index 431dd66..c5a1423 100644
--- a/src/manual.c
+++ b/src/manual.c
@@ -201,7 +201,7 @@ construct_manualname(char *buf, int which)
char *base = xmalloc(1024);
char *ptr;
int tmppos;
- strcpy(base, manual[manuallinks[which].line - 1]);
+ strncpy(base, manual[manuallinks[which].line - 1],1023);
strip_manual(base);
ptr = base + strlen(base) - 3;
while (((isalpha(*ptr)) ||(*ptr == '.') ||(*ptr == '_')) &&(ptr > base))
--
2.33.0

View File

@ -1,6 +1,6 @@
Name: pinfo
Version: 0.6.10
Release: 23
Release: 28
Summary: An user-friendly, console-based viewer for Info documents
License: GPLv2
URL: http://pinfo.alioth.debian.org
@ -12,6 +12,11 @@ Patch0004: pinfo-0.6.9-mansection.patch
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
Patch0010: 0004-Fix-link-order-in-ncurses-autoconf-test.patch
Patch0011: 0005-Fix-possible-out-of-buffer-write.patch
Patch0012: 0006-Fix-possible-buffer-overrun.patch
BuildRequires: ncurses-devel automake gettext-devel libtool texinfo
Requires: xdg-utils
@ -53,6 +58,21 @@ Pinfo-help provides man pages and other related help documents for pinfo.
%{_mandir}/man1/pinfo.1*
%changelog
* Thu Dec 28 2023 liyuanyuan <liyuanyuan@xfusion.com> - 0.6.10-28
- Fix possible buffer overrun
* 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
* 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
* Thu Oct 26 2023 liyuanyuan <liyuanyuan@xfusion.com> - 0.6.10-23
- Gracefully handle missing indirect info nodes