Compare commits

..

No commits in common. "rawhide" and "f37" have entirely different histories.

2 changed files with 17 additions and 89 deletions

View file

@ -1,55 +0,0 @@
From edc602651c506aeeb60544b55534dd1722a340d3 Mon Sep 17 00:00:00 2001
From: Rene Kita <mail@rkta.de>
Date: Thu, 13 Jul 2023 07:50:26 +0200
Subject: [PATCH] Fix OOB access due to multiple backspaces
Commit 419ca82d57 (Fix m17n backspace handling causes out-of-bounds
write in checkType) introduced an incomplete fix.
In function checkType we store the length of the previous multi-char
character in a buffer plens_buffer with pointer plens pointing to the
current position inside the buffer. When encountering a backspace plens
is set to the previous position without a bounds check. This will lead
to plens being out of bounds if we get more backspaces than we have
processed multi-char characters before.
If we are at the beginning of the buffer do not decrement and set plen
(the current length) to 0.
This also fixes GH Issue #270 [BUG] Out of bound read in Strnew_size ,
Str.c:61
If the above explanation does sound weird it's because I didn't fully
grok that function. :-)
---
etc.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/etc.c b/etc.c
index 128717b18..b56615136 100644
--- a/etc.c
+++ b/etc.c
@@ -393,7 +393,10 @@ checkType(Str s, Lineprop **oprop, Linecolor **ocolor)
if (color)
color -= plen;
#endif
- plen = *(--plens);
+ if (plens == plens_buffer)
+ plen = 0;
+ else
+ plen = *(--plens);
str += 2;
}
}
@@ -419,7 +422,10 @@ checkType(Str s, Lineprop **oprop, Linecolor **ocolor)
if (color)
color -= plen;
#endif
- plen = *(--plens);
+ if (plens == plens_buffer)
+ plen = 0;
+ else
+ plen = *(--plens);
str++;
}
#else

View file

@ -8,12 +8,18 @@
Name: w3m
Version: 0.5.3
Release: 69.git%{gitdate}%{?dist}
# Unicode-DFS-2015 is added for EastAsianWidth.txt source
License: MIT AND Unicode-DFS-2015
Release: 60.git%{gitdate}%{?dist}
# UCD is added for EastAsianWidth.txt source
License: MIT and UCD
URL: http://w3m.sourceforge.net/
BuildRequires: ncurses-devel
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: openssl-devel
%else
BuildRequires: openssl11-devel
# -Wnull-dereference requires GCC >= 6
BuildRequires: devtoolset-8-toolchain
%endif
BuildRequires: perl-generators
BuildRequires: pkgconfig
BuildRequires: gettext-devel
@ -32,8 +38,6 @@ Requires: perl(NKF)
Source0: https://github.com/tats/%{name}/archive/v%{version}+git%{gitdate}/%{name}-%{version}+git%{gitdate}.tar.gz
Source1: w3mconfig
Patch0: https://github.com/tats/w3m/pull/273/commits/edc602651c506aeeb60544b55534dd1722a340d3.patch#/w3m-0.5.3-fix-oob-access.patch
Summary: Pager with Web browsing abilities
Provides: webclient
Provides: text-www-browser
@ -53,7 +57,9 @@ w3m-img package as well.
%package img
Summary: Helper program to display the inline images for w3m
BuildRequires: gtk2-devel
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: gdk-pixbuf2-xlib-devel
%endif
Requires: ImageMagick
Requires: %{name}%{?_isa} = %{version}-%{release}
@ -66,7 +72,12 @@ linux framebuffer.
%autosetup -n %{name}-%{version}-git%{gitdate} -p1
%build
export CFLAGS="$CFLAGS -std=gnu17"
%if 0%{?rhel} == 7
. /opt/rh/devtoolset-8/enable
export SSL_CFLAGS="$(pkg-config --cflags-only-I openssl11)"
export SSL_LIBS="$(pkg-config --libs-only-L openssl11)"
%endif
%configure %{build_options}
%make_build
@ -98,34 +109,6 @@ rm -f doc*/w3m.1
%{_libexecdir}/w3m/w3mimgdisplay
%changelog
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-69.git20230121
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
* Sat Jun 13 2026 Yaakov Selkowitz <yselkowi@redhat.com> - 0.5.3-68.git20230121
- Rebuilt for openssl 4.0
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-67.git20230121
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-66.git20230121
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-65.git20230121
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-64.git20230121
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Mon Mar 18 2024 Robert Scheck <robert@fedoraproject.org> - 0.5.3-63.git20230121
- Added upstream patch to fix out-of-bounds access due to multiple backspaces
to address incomplete fix for CVE-2022-38223 (#2222775, #2222780, #2255207)
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-62.git20230121
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-61.git20230121
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Sun Jan 22 2023 Robert Scheck <robert@fedoraproject.org> - 0.5.3-60.git20230121
- Rebase to latest upstream gitrev 20230121 (#2163003)