[packages/a2ps] Rel 2. Fix one-byte stack overflow in the %D{} header escape.

arekm arekm at pld-linux.org
Thu Oct 29 07:20:14 CET 2026


commit 69c5fd44455029d269d4d6104b7bac61e2c7cc1c
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Oct 29 02:17:51 2026 +0100

    Rel 2. Fix one-byte stack overflow in the %D{} header escape.

 a2ps-date-format-overrun.patch | 14 ++++++++++++++
 a2ps.spec                      |  9 +++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/a2ps.spec b/a2ps.spec
index c510586..73f96f0 100644
--- a/a2ps.spec
+++ b/a2ps.spec
@@ -4,7 +4,7 @@ Summary(pl.UTF-8):	Filtr text/plain do Postscriptu
 Summary(zh_CN.UTF-8):	纯文本到Postscript转换器
 Name:		a2ps
 Version:	4.15.8
-Release:	1
+Release:	2
 License:	GPL v3+
 Group:		Applications/Text
 Source0:	https://ftp.gnu.org/gnu/a2ps/%{name}-%{version}.tar.gz
@@ -20,6 +20,7 @@ Patch5:		%{name}-glibcpaper.patch
 Patch6:		%{name}-autoenc.patch
 Patch7:		%{name}-i18n.patch
 Patch8:		%{name}-ogonkify-xfig-fix.patch
+Patch9:		%{name}-date-format-overrun.patch
 URL:		http://www.gnu.org/software/a2ps/
 BuildRequires:	autoconf >= 2.71
 BuildRequires:	automake >= 1:1.15
@@ -88,6 +89,7 @@ Tryb a2ps oraz obsługa drukowania przez a2ps dla Emacsa.
 %patch -P6 -p1
 %patch -P7 -p1
 %patch -P8 -p0
+%patch -P9 -p1
 
 %{__sed} -i -e '1s,/usr/bin/env sh,/bin/sh,' contrib/{card,fixps,lp2,pdiff}.in
 
@@ -109,7 +111,8 @@ install -d $RPM_BUILD_ROOT%{_datadir}/a2ps/{afm,fonts} \
 	$RPM_BUILD_ROOT%{_mandir}/pl/man1
 
 %{__make} install \
-	DESTDIR=$RPM_BUILD_ROOT
+	DESTDIR=$RPM_BUILD_ROOT \
+	AM_UPDATE_INFO_DIR=no
 
 install i18n-fonts-0.1/afm/*.afm $RPM_BUILD_ROOT%{_datadir}/a2ps/afm
 install i18n-fonts-0.1/fonts/*.pfb $RPM_BUILD_ROOT%{_datadir}/a2ps/fonts
@@ -156,6 +159,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_infodir}/ogonkify.info*
 
 %dir %{_datadir}/a2ps
+%{_datadir}/a2ps/README
 %dir %{_datadir}/a2ps/afm
 %{_datadir}/a2ps/afm/*.afm
 %{_datadir}/a2ps/afm/*.map
@@ -168,6 +172,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/a2ps/sheets
 
 %dir %{_datadir}/ogonkify
+%{_datadir}/ogonkify/README
 %{_datadir}/ogonkify/*.enc
 %{_datadir}/ogonkify/*.ps
 %{_datadir}/ogonkify/afm
diff --git a/a2ps-date-format-overrun.patch b/a2ps-date-format-overrun.patch
new file mode 100644
index 0000000..f721faa
--- /dev/null
+++ b/a2ps-date-format-overrun.patch
@@ -0,0 +1,14 @@
+%D{} with exactly 512 format chars writes the NUL one past buf2 (stack overflow)
+https://src.fedoraproject.org/rpms/a2ps/blob/rawhide/f/a2ps-overrun-static.patch
+
+--- a2ps-4.15.8.orig/liba2ps/metaseq.c	2025-12-04 16:28:37.000000000 +0100
++++ a2ps-4.15.8/liba2ps/metaseq.c	2026-10-29 02:12:10.526841638 +0100
+@@ -309,7 +309,7 @@
+ 	      {
+ 		/* `%D{}' format run date with strftime() */
+ 		for (j = 0, i += 2;
+-		     j < sizeof (buf2) && str[i] && str[i] != '}';
++		     j < sizeof (buf2) - 1 && str[i] && str[i] != '}';
+ 		     i++, j++)
+ 		  buf2[j] = str[i];
+ 		if (str[i] != '}')
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/a2ps.git/commitdiff/69c5fd44455029d269d4d6104b7bac61e2c7cc1c



More information about the pld-cvs-commit mailing list