[ncl] Fix build with -Werror=format-security (bug #1037211)
Orion Poplawski
orion at fedoraproject.org
Sat Feb 1 05:18:26 UTC 2014
commit ab285c0ed1c832cc928fe23a916b01525706ea4f
Author: Orion Poplawski <orion at cora.nwra.com>
Date: Fri Jan 31 22:18:50 2014 -0700
Fix build with -Werror=format-security (bug #1037211)
ncl-format.patch | 28 ++++++++++++++++++++++++++++
ncl.spec | 9 ++++++++-
2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/ncl-format.patch b/ncl-format.patch
new file mode 100644
index 0000000..8bb8bb7
--- /dev/null
+++ b/ncl-format.patch
@@ -0,0 +1,28 @@
+diff -up ncl_ncarg-6.1.2/ncarg2d/src/bin/logos/ncarlogo2ps.c.format ncl_ncarg-6.1.2/ncarg2d/src/bin/logos/ncarlogo2ps.c
+--- ncl_ncarg-6.1.2/ncarg2d/src/bin/logos/ncarlogo2ps.c.format 2013-02-06 20:27:05.000000000 -0700
++++ ncl_ncarg-6.1.2/ncarg2d/src/bin/logos/ncarlogo2ps.c 2014-01-31 22:12:22.919599594 -0700
+@@ -310,9 +310,9 @@ void InsertLogo(float angle, float size,
+ sprintf(rotate,"%10.2f ", angle);
+ sprintf(rotate+11,"rotate\n");
+
+- (void) fprintf(fp, translate);
+- (void) fprintf(fp, scale);
+- (void) fprintf(fp, rotate);
++ (void) fprintf(fp, "%s", translate);
++ (void) fprintf(fp, "%s", scale);
++ (void) fprintf(fp, "%s", rotate);
+ free(translate);
+ free(scale);
+ free(rotate);
+diff -up ncl_ncarg-6.1.2/ni/src/ncl/NclGRIB.c.format ncl_ncarg-6.1.2/ni/src/ncl/NclGRIB.c
+--- ncl_ncarg-6.1.2/ni/src/ncl/NclGRIB.c.format 2013-02-06 20:28:47.000000000 -0700
++++ ncl_ncarg-6.1.2/ni/src/ncl/NclGRIB.c 2014-01-31 22:13:44.255130250 -0700
+@@ -2282,7 +2282,7 @@ GribFileRecord *therec;
+ if (cp && ! strcmp(cp,"_hours")) {
+ if ((NrmQuark)therec->options[GRIB_INITIAL_TIME_COORDINATE_TYPE_OPT].values == NrmStringToQuark("numeric"))
+ continue;
+- sprintf(buffer,NrmQuarkToString(dimq));
++ sprintf(buffer,"%s",NrmQuarkToString(dimq));
+ cp = strrchr(buffer,'_');
+ *cp = '\0';
+ newdimq = NrmStringToQuark(buffer);
diff --git a/ncl.spec b/ncl.spec
index 372166a..7a168e4 100644
--- a/ncl.spec
+++ b/ncl.spec
@@ -1,6 +1,6 @@
Name: ncl
Version: 6.1.2
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: NCAR Command Language and NCAR Graphics
Group: Applications/Engineering
@@ -31,6 +31,9 @@ Patch1: ncarg-4.4.1-deps.patch
Patch2: ncl-5.1.0-ppc64.patch
# Add needed -lm to ictrans build, remove unneeded -lrx -lidn -ldl from ncl
Patch3: ncl-libs.patch
+# Fix build with -Werror=format-security
+# https://bugzilla.redhat.com/show_bug.cgi?id=1037211
+Patch4: ncl-format.patch
# don't have the installation target depends on the build target since
# for library it implies running ranlib and modifying the library timestamp
Patch10: ncl-5.0.0-no_install_dep.patch
@@ -128,6 +131,7 @@ Example programs and data using NCL.
%patch1 -p1 -b .deps
%patch2 -p1 -b .ppc64
%patch3 -p1 -b .libs
+%patch4 -p1 -b .format
%patch10 -p1 -b .no_install_dep
%patch11 -p1 -b .build_n_scripts
%patch12 -p1 -b .netcdff
@@ -344,6 +348,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Fri Jan 31 2014 Orion Poplawski - 6.1.2-6
+- Fix build with -Werror=format-security (bug #1037211)
+
* Sun Sep 22 2013 Orion Poplawski - 6.1.2-5
- Rebuild for atlas 3.10
More information about the scm-commits
mailing list