[a2ps] Avoid a bad free in the encoding handling logic (bug #954104).
Tim Waugh
twaugh at fedoraproject.org
Tue Apr 30 11:55:37 UTC 2013
commit 27cd62dcec8afe1284fdd1afd17bdf3ac7edade8
Author: Tim Waugh <twaugh at redhat.com>
Date: Tue Apr 30 11:53:36 2013 +0100
Avoid a bad free in the encoding handling logic (bug #954104).
a2ps-bad-free.patch | 14 ++++++++++++++
a2ps.spec | 9 ++++++++-
2 files changed, 22 insertions(+), 1 deletions(-)
---
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 <twaugh at redhat.com> - 4.14-20
+- Avoid a bad free in the encoding handling logic (bug #954104).
+
* Mon Apr 29 2013 Tim Waugh <twaugh at redhat.com> - 4.14-19
- Support for building on aarch64 (bug #924962).
More information about the scm-commits
mailing list