[coin-or-CoinUtils] Correct build with -Werror=format-security (#1037021) Correct build with -Werror=format-security (#

pcpa pcpa at fedoraproject.org
Mon Dec 16 14:59:36 UTC 2013


commit 59237b04629039a2b590d3c53aab0dae83bb73d9
Author: pcpa <paulo.cesar.pereira.de.andrade at gmail.com>
Date:   Mon Dec 16 12:59:36 2013 -0200

     Correct build with -Werror=format-security (#1037021) Correct build with -Werror=format-security (#1037021)

 coin-or-CoinUtils-format.patch |   12 ++++++++++++
 coin-or-CoinUtils.spec         |   11 ++++++++++-
 2 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/coin-or-CoinUtils-format.patch b/coin-or-CoinUtils-format.patch
new file mode 100644
index 0000000..6d27959
--- /dev/null
+++ b/coin-or-CoinUtils-format.patch
@@ -0,0 +1,12 @@
+diff -up CoinUtils-2.9.7/src/CoinMessageHandler.cpp.orig CoinUtils-2.9.7/src/CoinMessageHandler.cpp
+--- CoinUtils-2.9.7/src/CoinMessageHandler.cpp.orig	2013-12-16 12:50:16.715397458 -0200
++++ CoinUtils-2.9.7/src/CoinMessageHandler.cpp	2013-12-16 12:50:41.994398426 -0200
+@@ -820,7 +820,7 @@ CoinMessageHandler::operator<< (double d
+ 	  sprintf(messageOut_,g_format_,doublevalue);
+ 	  if (next != format_+2) {
+ 	    messageOut_+=strlen(messageOut_);
+-	    sprintf(messageOut_,format_+2);
++	    sprintf(messageOut_,"%s",format_+2);
+ 	  }
+ 	}
+ 	messageOut_+=strlen(messageOut_);
diff --git a/coin-or-CoinUtils.spec b/coin-or-CoinUtils.spec
index 6c3cabd..185a2c4 100644
--- a/coin-or-CoinUtils.spec
+++ b/coin-or-CoinUtils.spec
@@ -4,7 +4,7 @@ Name:		coin-or-%{module}
 Group:		Applications/Engineering
 Summary:	Coin-or Utilities
 Version:	2.9.7
-Release:	2%{?dist}
+Release:	3%{?dist}
 License:	EPL
 URL:		http://projects.coin-or.org/%{module}
 Source0:	http://www.coin-or.org/download/pkgsource/%{module}/%{module}-%{version}.tgz
@@ -24,6 +24,9 @@ Patch1:		%{name}-docdir.patch
 # Correct undefined non weak symbols
 Patch2:		%{name}-underlink.patch
 
+# Correct -Werror=format-security
+Patch3:		%{name}-format.patch
+
 %description
 CoinUtils (Coin-or Utilities) is an open-source collection of classes
 and functions that are generally useful to more than one COIN-OR project.
@@ -58,8 +61,11 @@ This package contains the documentation for %{name}.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %build
+export CFLAGS="%{optflags} -Werror=format-security"
+export CXXFLAGS="$CFLAGS"
 %configure
 make %{?_smp_flags} all doxydoc
 
@@ -92,6 +98,9 @@ make test
 %doc %{_docdir}/%{name}/html
 
 %changelog
+* Mon Dec 16 2013 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 2.9.7-3
+- Correct build with -Werror=format-security (#1037021)
+
 * Fri Nov  1 2013 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 2.9.7-2
 - Use proper _smp_flags macro (#894586#c6).
 - Make package owner of /usr/include/coin (#894586#c6)


More information about the scm-commits mailing list