[rasmol] Fix Werror=format-security issue.
Dmitrij S. Kryzhevich
krege at fedoraproject.org
Wed Feb 12 11:04:29 UTC 2014
commit 4da93903c4e3b0c129f3226a3585ec28126c02c4
Author: Dmitrij S. Kryzhevich <krege at land.ru>
Date: Wed Feb 12 18:05:05 2014 +0700
Fix Werror=format-security issue.
RasMol-2.7.5.2_sprintf.patch | 39 +++++++++++++++++++++++++++++++++++++++
rasmol.spec | 8 +++++++-
2 files changed, 46 insertions(+), 1 deletions(-)
---
diff --git a/RasMol-2.7.5.2_sprintf.patch b/RasMol-2.7.5.2_sprintf.patch
new file mode 100644
index 0000000..22eb229
--- /dev/null
+++ b/RasMol-2.7.5.2_sprintf.patch
@@ -0,0 +1,39 @@
+diff -urp RasMol-2.7.5.2/src/command.c RasMol-2.7.5.2_sprintf/src/command.c
+--- RasMol-2.7.5.2/src/command.c 2011-05-15 01:23:49.000000000 +0700
++++ RasMol-2.7.5.2_sprintf/src/command.c 2014-02-12 18:02:24.633489549 +0700
+@@ -1286,7 +1286,7 @@ void ShowRecordCommand( void ) {
+ if (record_on[1]) WriteString("record appearance on\n");
+ else WriteString("record apperance off\n");
+ if (RecordMaxMS == 1.) {
+- sprintf(param,RecordTemplate);
++ sprintf(param, "%s", RecordTemplate);
+ } else{
+ sprintf(param,RecordTemplate,millisec<0?0:millisec);
+ }
+@@ -1381,7 +1381,7 @@ void ShowPlayCommand( void ) {
+ WriteString(param);
+ }
+ if (PlayMaxMS == 1.) {
+- sprintf(param,PlayTemplate);
++ sprintf(param, "%s", PlayTemplate);
+ } else{
+ sprintf(param,PlayTemplate,millisec<0?0:millisec);
+ }
+@@ -1469,7 +1469,7 @@ void WriteMovieFrame( void ) {
+ RecordPause = True;
+ } else {
+ if (RecordMaxMS == 1.) {
+- sprintf(param,RecordTemplate);
++ sprintf(param, "%s", RecordTemplate);
+ } else{
+ sprintf(param,RecordTemplate,millisec);
+ }
+@@ -1505,7 +1505,7 @@ static int PlayMovieFrame( void ) {
+ for (play_frame[1] = 0;play_frame[1]<=millisec; play_frame[1]++)
+ {
+ if (RecordMaxMS == 1.) {
+- sprintf(param,PlayTemplate);
++ sprintf(param, "%s", PlayTemplate);
+ } else{
+ sprintf(param,PlayTemplate,millisec-play_frame[1]);
+ }
diff --git a/rasmol.spec b/rasmol.spec
index 261c055..96f72cd 100644
--- a/rasmol.spec
+++ b/rasmol.spec
@@ -1,7 +1,7 @@
Name: rasmol
Summary: Molecular Graphics Visualization Tool
Version: 2.7.5.2
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2 and LGPLv2
Group: Applications/Engineering
URL: http://www.rasmol.org
@@ -13,6 +13,7 @@ Source4: rasmol
Patch1: rasmol-2.7.5-23Jul09-gtk.patch
Patch2: rasmol-2.7.5-23Jul09-64b.patch
Patch3: rasmol-2.7.5-23Jul09-man.patch
+Patch4: RasMol-2.7.5.2_sprintf.patch
BuildRequires: desktop-file-utils
BuildRequires: imake
@@ -66,6 +67,8 @@ BuildArch: noarch
%endif
# Fix man file
%patch3 -p1
+# Fix build error with -Werror=format-security
+%patch4 -p1
pushd src
# Fix harcoded vars
@@ -179,6 +182,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{_datadir}/%{name}/data/*
%changelog
+* Wed Feb 12 2014 Dmitrij S. Kryzhevich <krege at land.ru> 2.7.5.2-2
+- Fix Werror=format-security build error.
+
* Tue Sep 24 2013 Dmitrij S. Kryzhevich <krege at land.ru> 2.7.5.2-1
- Update to 2.7.5.2 version.
More information about the scm-commits
mailing list