[digitemp] Solved build failures with "-Werror=format-security" (#1037039)

Robert Scheck robert at fedoraproject.org
Sun Dec 8 00:41:01 UTC 2013


commit 3560b555a3ed1f8cbce17d30919cb0cf16c84ef3
Author: Robert Scheck <robert at fedoraproject.org>
Date:   Sun Dec 8 01:40:56 2013 +0100

    Solved build failures with "-Werror=format-security" (#1037039)

 digitemp-3.6.0-cflags.patch          |    2 ++
 digitemp-3.6.0-format-security.patch |   28 ++++++++++++++++++++++++++++
 digitemp.spec                        |    7 ++++++-
 3 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/digitemp-3.6.0-cflags.patch b/digitemp-3.6.0-cflags.patch
index a4aa163..ced5922 100644
--- a/digitemp-3.6.0-cflags.patch
+++ b/digitemp-3.6.0-cflags.patch
@@ -1,6 +1,8 @@
 Patch by Robert Scheck <robert at fedoraproject.org> for digitemp >= 3.6.0,
 which forces the use of $RPM_OPT_FLAGS to have a usable -debuginfo package.
 
+Proposed to upstream via e-mail at Sun, 8 Dec 2013 01:37:56 +0100.
+
 --- digitemp-3.6.0/Makefile		2008-08-28 23:37:00.000000000 +0200
 +++ digitemp-3.6.0/Makefile.cflags	2009-01-25 20:49:03.000000000 +0100
 @@ -12,7 +12,7 @@
diff --git a/digitemp-3.6.0-format-security.patch b/digitemp-3.6.0-format-security.patch
new file mode 100644
index 0000000..e2d5a46
--- /dev/null
+++ b/digitemp-3.6.0-format-security.patch
@@ -0,0 +1,28 @@
+Patch by Robert Scheck <robert at fedoraproject.org> for digitemp >= 3.6.0, which fixes the
+build failures if compiled with "-Werror=format-security". For further information please
+also have a look to https://bugzilla.redhat.com/show_bug.cgi?id=1037039
+
+Proposed to upstream via e-mail at Sun, 8 Dec 2013 01:37:56 +0100.
+
+--- digitemp-3.6.0/src/digitemp.c			2008-08-28 06:42:48.000000000 +0200
++++ digitemp-3.6.0/src/digitemp.c.format-security	2013-12-08 01:23:11.000000000 +0100
+@@ -586,7 +586,7 @@
+       perror("Error loging to logfile");
+     close( fd );
+   } else {
+-    printf( line );
++    printf("%s", line );
+   }
+   return 0;
+ }  
+--- digitemp-3.6.0/userial/ioutil.c			2007-06-07 23:25:58.000000000 +0200
++++ digitemp-3.6.0/userial/ioutil.c.format-security	2013-12-08 01:24:49.000000000 +0100
+@@ -86,7 +86,7 @@
+    // remember the start length
+    deflen = strlen(buf);
+    if (deflen < 80)
+-      sprintf(defbuf,buf);
++      sprintf(defbuf,"%s",buf);
+    else
+       defbuf[0] = 0;
+ 
diff --git a/digitemp.spec b/digitemp.spec
index a7d3ef7..2dd1f77 100644
--- a/digitemp.spec
+++ b/digitemp.spec
@@ -3,7 +3,7 @@
 Summary:           Dallas Semiconductor 1-wire device reading console application
 Name:              digitemp
 Version:           3.6.0
-Release:           9%{?dist}
+Release:           10%{?dist}
 License:           GPLv2+
 Group:             Applications/System
 URL:               http://www.digitemp.com/
@@ -11,6 +11,7 @@ Source0:           http://www.digitemp.com/software/linux/%{name}-%{version}.tar
 Source1:           dthowto.txt
 Source2:           DS9097_Schematic.gif
 Patch0:            digitemp-3.6.0-cflags.patch
+Patch1:            digitemp-3.6.0-format-security.patch
 %if %{with_libusb}
 BuildRequires:     libusb-devel
 %endif
@@ -28,6 +29,7 @@ MicroLAN Coupler (used in 1-wire hubs) and the AAG TAI-8540 humidity sensor.
 %prep
 %setup -q
 %patch0 -p1 -b .cflags
+%patch1 -p1 -b .format-security
 cp -pf %{SOURCE1} %{SOURCE2} .
 
 %build
@@ -63,6 +65,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/%{name}.*
 
 %changelog
+* Sun Dec 08 2013 Robert Scheck <robert at fedoraproject.org> 3.6.0-10
+- Solved build failures with "-Werror=format-security" (#1037039)
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.6.0-9
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list