[grads] Fix format-security build error
Deji Akingunola
deji at fedoraproject.org
Tue Feb 25 03:47:42 UTC 2014
commit 8b8a710bedf377e90fe14ff94f36e6644901094b
Author: Deji Akingunola <dakingun at gmail.com>
Date: Mon Feb 24 22:48:34 2014 -0500
Fix format-security build error
grads-format-security.patch | 25 +++++++++++++++++++++++++
grads.spec | 7 ++++++-
2 files changed, 31 insertions(+), 1 deletions(-)
---
diff --git a/grads-format-security.patch b/grads-format-security.patch
new file mode 100644
index 0000000..c6a8533
--- /dev/null
+++ b/grads-format-security.patch
@@ -0,0 +1,25 @@
+--- src/gagx.c 2012-10-25 10:47:00.000000000 -0400
++++ src/gagx.c.new 2014-02-24 22:29:27.227723077 -0500
+@@ -3639,7 +3639,7 @@
+ else {
+ len = strlen(pcm->shpfname);
+ fnroot = (char *)galloc(len+1,"shpfn");
+- snprintf(fnroot,len+1,pcm->shpfname);
++ snprintf(fnroot,len+1,"%s",pcm->shpfname);
+ }
+ if ((dbfid = DBFCreate(fnroot))==NULL) {
+ gaprnt(0,"Error in gashpwrt: Unable to create data base file\n");
+@@ -4958,11 +4958,11 @@
+
+ if (pcm->ffile != stdout) {
+ if (pcm->fwname) {
+- snprintf(pout,255,"Wrote %ld of %i elements to ", written, exsz);
++ snprintf(pout,255,"Wrote %ld of %i elements to ", (long)written, exsz);
+ gaprnt (2,pout);
+ gaprnt (2,pcm->fwname);
+ } else {
+- snprintf(pout,255,"Wrote %ld of %i elements to grads.fwrite", written, exsz);
++ snprintf(pout,255,"Wrote %ld of %i elements to grads.fwrite", (long)written, exsz);
+ gaprnt (2,pout);
+ }
+
diff --git a/grads.spec b/grads.spec
index d107003..b860c67 100644
--- a/grads.spec
+++ b/grads.spec
@@ -1,6 +1,6 @@
Name: grads
Version: 2.0.2
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Tool for easy acces, manipulation, and visualization of data
Group: Applications/Engineering
@@ -12,6 +12,7 @@ Source0: ftp://iges.org/grads/2.0/grads-%{version}-src.tar.gz
Patch0: grads-use-system-libshp_libsx.patch
Patch1: grads-libpng15.patch
+Patch2: grads-format-security.patch
BuildRequires: hdf-static hdf-devel hdf5-devel netcdf-devel
BuildRequires: g2clib-static g2clib-devel
@@ -40,6 +41,7 @@ commonly used operating systems and is freely distributed over the Internet.
%setup -q
%patch0 -p0 -b .sys
%patch1 -p0 -b .png15
+%patch1 -p0 -b .fmt
# change path to datas to %{_datadir}/%{name}
sed -i -e 's@/usr/local/lib/grads@%{_datadir}/%{name}@' src/gxsubs.c
autoreconf -f -i
@@ -84,6 +86,9 @@ make install DESTDIR=$RPM_BUILD_ROOT
%changelog
+* Mon Feb 24 2014 Deji Akingunola <dakingun at gmail.com> - 2.0.2-4
+- Apply patch to fix format-security build error (Bug 1037101)
+
* Thu Aug 15 2013 Deji Akingunola <dakingun at gmail.com> - 2.0.2-3
- Update libpng patch for libpng16
More information about the scm-commits
mailing list