From 27cd62dcec8afe1284fdd1afd17bdf3ac7edade8 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Apr 30 2013 11:34:00 +0000 Subject: Avoid a bad free in the encoding handling logic (bug #954104). --- diff --git a/a2ps-bad-free.patch b/a2ps-bad-free.patch new file mode 100644 index 0000000..9f03b55 --- /dev/null +++ b/a2ps-bad-free.patch @@ -0,0 +1,14 @@ +diff -up a2ps-4.14/lib/encoding.c.bad-free a2ps-4.14/lib/encoding.c +--- a2ps-4.14/lib/encoding.c.bad-free 2013-04-30 11:49:50.511962062 +0100 ++++ a2ps-4.14/lib/encoding.c 2013-04-30 11:52:18.682573468 +0100 +@@ -541,7 +541,9 @@ encoding_resolve_font_substitute (struct + { + /* Find if there is a substitute for that font */ + res = pair_get (encoding->substitutes, font_name); +- if (!res) ++ if (res) ++ res = xstrdup (res); ++ else + /* No. Check if this font is supported */ + if (font_exists (job, font_name)) + /* Avoid returning sth alloca'd */ diff --git a/a2ps.spec b/a2ps.spec index 20a8305..356db59 100644 --- a/a2ps.spec +++ b/a2ps.spec @@ -1,7 +1,7 @@ Summary: Converts text and other types of files to PostScript Name: a2ps Version: 4.14 -Release: 19%{?dist} +Release: 20%{?dist} License: GPLv3+ Group: Applications/Publishing Source0: http://ftp.gnu.org/gnu/a2ps/%{name}-%{version}.tar.gz @@ -23,6 +23,7 @@ Patch12: a2ps-4.13b-attr.patch Patch13: a2ps-4.13b-numeric.patch Patch14: a2ps-4.13b-encoding.patch Patch15: a2ps-4.13b-tilde.patch +Patch16: a2ps-bad-free.patch Patch17: a2ps-4.13-euckr.patch Patch18: a2ps-4.13-gnusource.patch Patch20: a2ps-4.13-hebrew.patch @@ -126,6 +127,9 @@ the emacs-%{name} package to use emacs-%{name} with GNU Emacs. # Fix koi8 tilde (bug #66393). %patch15 -p1 -b .tilde +# Avoid a bad free in the encoding handling logic (bug #954104). +%patch16 -p1 -b .bad-free + # Add Korean resource file (bug #81421). %patch17 -p1 -b .euckr @@ -305,6 +309,9 @@ exit 0 %{_emacs_sitelispdir}/%{name}/*.el %changelog +* Tue Apr 30 2013 Tim Waugh - 4.14-20 +- Avoid a bad free in the encoding handling logic (bug #954104). + * Mon Apr 29 2013 Tim Waugh - 4.14-19 - Support for building on aarch64 (bug #924962).