From f1ff483ef0e51c979c9fd379259782732f73b3ef Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Aug 10 2011 15:46:03 +0000 Subject: Coverity fix (forward-null). --- diff --git a/a2ps-forward-null.patch b/a2ps-forward-null.patch new file mode 100644 index 0000000..792f39d --- /dev/null +++ b/a2ps-forward-null.patch @@ -0,0 +1,19 @@ +diff -up a2ps-4.14/lib/pathwalk.c.forward-null a2ps-4.14/lib/pathwalk.c +--- a2ps-4.14/lib/pathwalk.c.forward-null 2011-08-10 16:06:53.185942197 +0100 ++++ a2ps-4.14/lib/pathwalk.c 2011-08-10 16:08:36.831030924 +0100 +@@ -348,12 +348,12 @@ xpw_find_included_file (char * const *pa + /* Relative. Give its root. */ + dir = dir_name (including_file); + +- res = ALLOCA (char, (strlen (dir) ++ res = ALLOCA (char, ((dir ? strlen (dir) : 0) + + strlen (name) + + (suffix ? strlen (suffix) : 0) + + 2)); +- sprintf (res, "%s%c%s%s", dir, DIRECTORY_SEPARATOR, +- name, suffix ? suffix : ""); ++ sprintf (res, "%s%c%s%s", dir ? dir : "", DIRECTORY_SEPARATOR, ++ dir ? name : name + 1, suffix ? suffix : ""); + XFREE (dir); + if (stat (res, &statbuf) == 0) + return xstrdup (res); diff --git a/a2ps.spec b/a2ps.spec index d01dd3a..3e145a6 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: 12%{?dist} +Release: 13%{?dist} License: GPLv3+ Group: Applications/Publishing Source0: http://ftp.gnu.org/gnu/a2ps/%{name}-%{version}.tar.gz @@ -29,6 +29,7 @@ Patch29: a2ps-U.patch Patch31: a2ps-mb.patch Patch34: a2ps-external-libtool.patch Patch35: a2ps-4.14-texinfo-nodes.patch +Patch36: a2ps-forward-null.patch Requires: fileutils sh-utils info BuildRequires: gperf BuildRequires: emacs, flex, libtool, texinfo, groff @@ -139,6 +140,9 @@ the emacs-%{name} package to use emacs-%{name} with GNU Emacs. # Remove dots in node names, patch from Vitezslav Crhonek (Bug #445971) %patch35 -p1 -b .nodes +# Coverity fix (forward-null). +%patch36 -p1 -b .forward-null + for file in AUTHORS ChangeLog; do iconv -f latin1 -t UTF-8 < $file > $file.utf8 touch -c -r $file $file.utf8 @@ -278,6 +282,9 @@ exit 0 %{_emacs_sitelispdir}/%{name}/*.el %changelog +* Wed Aug 10 2011 Tim Waugh - 4.14-13 +- Coverity fix (forward-null). + * Mon Feb 07 2011 Fedora Release Engineering - 4.14-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild