[posterazor] Fix FTBFS with -Werror=format-security (#1037255, #1106663)
Yaakov Selkowitz
yselkowitz at fedoraproject.org
Tue Jul 8 02:55:25 UTC 2014
commit 6bf87e4546944335a8d0ce54293998560fd0c13d
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date: Mon Jun 23 15:34:03 2014 -0500
Fix FTBFS with -Werror=format-security (#1037255, #1106663)
posterazor-1.5-format-security.patch | 31 +++++++++++++++++++++++++++++++
posterazor.spec | 14 +++++++-------
2 files changed, 38 insertions(+), 7 deletions(-)
---
diff --git a/posterazor-1.5-format-security.patch b/posterazor-1.5-format-security.patch
new file mode 100644
index 0000000..ee5baf2
--- /dev/null
+++ b/posterazor-1.5-format-security.patch
@@ -0,0 +1,31 @@
+--- a/src/FlPosteRazorDialog.cpp
++++ b/src/FlPosteRazorDialog.cpp
+@@ -432,7 +432,7 @@ void FlPosteRazorDialog::loadInputImage(const char *fileName)
+ loaded = m_posteRazorController->loadInputImage(loadFileName, errorMessage, sizeof(errorMessage));
+ if (!loaded) {
+ if (strlen(errorMessage) > 0)
+- fl_message(errorMessage);
++ fl_message("%s", errorMessage);
+ else
+ fl_message(Translations::instance().fileCouldNotBeLoaded(), fl_filename_name(loadFileName));
+ }
+@@ -603,7 +603,7 @@ void FlPosteRazorDialog::savePoster(void)
+ fileExistsAskUserForOverwrite = my_file_exists(saveFileName);
+ char overwriteQuestion[1024] = "";
+ sprintf(overwriteQuestion, Translations::instance().overwriteFile(), fl_filename_name(saveFileName));
+- if (!fileExistsAskUserForOverwrite || fl_ask(overwriteQuestion)) {
++ if (!fileExistsAskUserForOverwrite || fl_ask("%s", overwriteQuestion)) {
+ int err = m_posteRazorController->savePoster(saveFileName);
+ if (err)
+ fl_message(Translations::instance().fileCouldNotBeSaved(), fl_filename_name(saveFileName));
+--- a/src/PosteRazorPDFOutput.cpp
++++ b/src/PosteRazorPDFOutput.cpp
+@@ -397,7 +397,7 @@ public:
+ int err = 0;
+
+ const unsigned int startxref = ftell(m_outputFile);
+- fprintf(m_outputFile, m_xref);
++ fprintf(m_outputFile, "%s", m_xref);
+
+ fprintf (
+ m_outputFile,
diff --git a/posterazor.spec b/posterazor.spec
index 61d2826..d45908a 100644
--- a/posterazor.spec
+++ b/posterazor.spec
@@ -1,6 +1,6 @@
Name: posterazor
Version: 1.5
-Release: 13%{?dist}
+Release: 14%{?dist}
Summary: Make your own poster
Group: Applications/Publishing
@@ -9,7 +9,7 @@ URL: http://%{name}.sourceforge.net/index.php
Source0: http://prdownloads.sourceforge.net/%{name}/PosteRazor-%{version}-Source.zip
Source1: %{name}.desktop
Patch0: %{name}-%{version}-includes.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Patch1: posterazor-1.5-format-security.patch
BuildRequires: cmake freeimage-devel fltk-devel libXpm-devel
BuildRequires: desktop-file-utils
@@ -23,6 +23,7 @@ An easy to use, wizard like user interface guides through 5 steps.
%prep
%setup -q -c
%patch0 -p1 -b .includes
+%patch1 -p1 -b .formatsec
for i in CHANGES LICENSE README
do
sed -e 's/\r//' $i > $i.tmp
@@ -45,7 +46,6 @@ cd src
make %VERBOSE=1 %{?_smp_mflags}
%install
-rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps/
install -pm 755 src/PosteRazor $RPM_BUILD_ROOT/%{_bindir}
@@ -55,12 +55,8 @@ desktop-file-install --vendor="" \
--dir $RPM_BUILD_ROOT%{_datadir}/applications/ \
%{SOURCE1}
-%clean
-rm -rf $RPM_BUILD_ROOT
-
%files
-%defattr(-,root,root,-)
%doc CHANGES LICENSE README
%{_bindir}/PosteRazor
%{_datadir}/applications/%{name}.desktop
@@ -68,6 +64,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Mon Jun 23 2014 Yaakov Selkowitz <yselkowi at redhat.com> - 1.5-14
+- Fix FTBFS with -Werror=format-security (#1037255, #1106663)
+- Cleanup spec
+
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.5-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
More information about the scm-commits
mailing list