[wgrib2] Fix -Werror=format-security (bug #1037383)
Orion Poplawski
orion at fedoraproject.org
Tue Dec 3 19:43:09 UTC 2013
commit 73d55c9dc79906536c553256600692a8ad2c6733
Author: Orion Poplawski <orion at nwra.com>
Date: Tue Dec 3 12:43:05 2013 -0700
Fix -Werror=format-security (bug #1037383)
wgrib2-format.patch | 12 ++++++++++++
wgrib2.spec | 9 ++++++++-
2 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/wgrib2-format.patch b/wgrib2-format.patch
new file mode 100644
index 0000000..7f3700f
--- /dev/null
+++ b/wgrib2-format.patch
@@ -0,0 +1,12 @@
+diff -up grib2/wgrib2/Ensemble.c.format grib2/wgrib2/Ensemble.c
+--- grib2/wgrib2/Ensemble.c.format 2013-04-03 09:00:08.000000000 -0600
++++ grib2/wgrib2/Ensemble.c 2013-12-03 12:38:32.984321552 -0700
+@@ -56,7 +56,7 @@ int f_ens(ARG0) {
+ case 194: if (center == NCEP) string = "50%"; break;
+ case 195: if (center == NCEP) string = "90%"; break;
+ }
+- sprintf(inv_out,string);
++ sprintf(inv_out,"%s",string);
+ inv_out += strlen(inv_out);
+ }
+ }
diff --git a/wgrib2.spec b/wgrib2.spec
index bfa8e25..bf38998 100644
--- a/wgrib2.spec
+++ b/wgrib2.spec
@@ -1,6 +1,6 @@
Name: wgrib2
Version: 1.9.9
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Manipulate, inventory and decode GRIB2 files
Group: Applications/Engineering
@@ -11,6 +11,9 @@ Source0: http://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2_nolib.tgz.v%{v
Source1: config.h
# Disable gctpc for now - bundled library
Patch0: wgrib2-nogctpc.patch
+# Fix -Werror=format-security
+# https://bugzilla.redhat.com/show_bug.cgi?id=1037383
+Patch1: wgrib2-format.patch
BuildRequires: g2clib-static, zlib-devel, netcdf-devel
BuildRequires: mysql-devel
@@ -23,6 +26,7 @@ extract data. You can do basic database operations and other nifty things.
%prep
%setup -q -n grib2
%patch0 -p1 -b .nogctpc
+%patch1 -p1 -b .format
rm -r g2clib-* wgrib2/{fnlist,Gctpc,gctpc_ll2xy,new_grid_lambertc}.[ch]
cp %SOURCE1 wgrib2/config.h
@@ -46,6 +50,9 @@ install wgrib2/wgrib2 $RPM_BUILD_ROOT%{_bindir}/wgrib2
%changelog
+* Tue Dec 3 2013 Orion Poplawski <orion at cora.nwra.com> - 1.9.9-2
+- Fix -Werror=format-security (bug #1037383)
+
* Fri Sep 20 2013 Orion Poplawski <orion at cora.nwra.com> - 1.9.9-1
- Update to 1.9.9
More information about the scm-commits
mailing list