[clpbar] Patch display.c and args.c for errors caught by -Werror=format-security
David Cantrell
dcantrel at fedoraproject.org
Thu Jun 12 19:40:48 UTC 2014
commit a52f12f779e825ee498392c4fb4b4a09e811b4f9
Author: David Cantrell <dcantrell at redhat.com>
Date: Thu Jun 12 15:40:32 2014 -0400
Patch display.c and args.c for errors caught by -Werror=format-security
(#1106063)
bar-1.10.9-Werror=format-security.patch | 70 +++++++++++++++++++++++++++++++
clpbar.spec | 7 +++-
2 files changed, 76 insertions(+), 1 deletions(-)
---
diff --git a/bar-1.10.9-Werror=format-security.patch b/bar-1.10.9-Werror=format-security.patch
new file mode 100644
index 0000000..6430c9e
--- /dev/null
+++ b/bar-1.10.9-Werror=format-security.patch
@@ -0,0 +1,70 @@
+diff -up bar-1.10.9/args.c.orig bar-1.10.9/args.c
+--- bar-1.10.9/args.c.orig 2014-06-12 15:37:42.884747232 -0400
++++ bar-1.10.9/args.c 2007-06-28 09:09:58.000000000 -0400
+@@ -587,7 +587,7 @@ void help(FILE *out)
+ fprintf(out, "\n ");
+ screen_used = 7;
+ }
+- fprintf(out, "%s", option_buffer);
++ fprintf(out, option_buffer);
+ screen_used += strlen(option_buffer);
+ }
+
+@@ -615,7 +615,7 @@ void help(FILE *out)
+ fprintf(out, "\n ");
+ screen_used = 7;
+ }
+- fprintf(out, "%s", option_buffer);
++ fprintf(out, option_buffer);
+ screen_used += strlen(option_buffer);
+ }
+
+@@ -2808,12 +2808,12 @@ int parse_rcfiles(FILE *ferr)
+
+ home_dir = getenv("HOME");
+ if (home_dir != 0) {
+- sprintf(filename, "%.*s/.clpbarrc", 4091, home_dir);
++ sprintf(filename, "%.*s/.barrc", 4088, home_dir);
+ if (parse_rcfile(ferr, filename) != 0)
+ return(1);
+ }
+
+- sprintf(filename, "./.clpbarrc");
++ sprintf(filename, "./.barrc");
+ if (parse_rcfile(ferr, filename) != 0)
+ return(1);
+
+diff -up bar-1.10.9/display.c.orig bar-1.10.9/display.c
+--- bar-1.10.9/display.c.orig 2007-06-06 15:07:41.000000000 -0400
++++ bar-1.10.9/display.c 2014-06-12 15:36:51.132747232 -0400
+@@ -308,10 +308,10 @@ void displayAnsi(char *fg, char *bg, int
+ {
+ if (d.display_ansi) {
+ if (fg != 0) {
+- fprintf(stderr, fg);
++ fprintf(stderr, "%s", fg);
+ }
+ if (bg != 0) {
+- fprintf(stderr, bg);
++ fprintf(stderr, "%s", bg);
+ }
+ if (b) {
+ fprintf(stderr, "[1m");
+@@ -702,7 +702,7 @@ int displayEnd(void)
+
+ fprintf(stderr, "\n");
+ if (d.display_summary) {
+- fprintf(stderr, "Copied: %llu%s (%.1f%s)",
++ fprintf(stderr, "Copied: %lu%s (%.1f%s)",
+ UINT64_CTYPE(total_count),
+ total_count_units,
+ short_count,
+@@ -732,7 +732,7 @@ int displayEnd(void)
+ fprintf(stderr, "\n");
+
+ if ((hours != 0) || (minutes != 0) || (seconds != 0)) {
+- fprintf(stderr, "Throughput: %llu%s (%.1f%s)\n\n",
++ fprintf(stderr, "Throughput: %lu%s (%.1f%s)\n\n",
+ UINT64_CTYPE(total_throughput),
+ total_throughput_units,
+ short_throughput,
diff --git a/clpbar.spec b/clpbar.spec
index 353415d..3c97c65 100644
--- a/clpbar.spec
+++ b/clpbar.spec
@@ -1,6 +1,6 @@
Name: clpbar
Version: 1.10.9
-Release: 9%{?dist}
+Release: 10%{?dist}
Summary: Show information about a data transfer
Group: Applications/System
@@ -10,6 +10,7 @@ Source0: http://downloads.sourceforge.net/%{name}/bar_%{version}.tar.gz
Source1: clpbar.1.in
Patch0: bar-1.10.9-clpbar.patch
Patch1: bar-1.10.9-Makefile.patch
+Patch2: bar-1.10.9-Werror=format-security.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
@@ -53,6 +54,10 @@ rm -rf %{buildroot}
%{_mandir}/man1/clpbar.1.gz
%changelog
+* Thu Jun 12 2014 David Cantrell <dcantrell at redhat.com> - 1.10.9-10
+- Patch display.c and args.c for errors caught by -Werror=format-security
+ (#1106063)
+
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.10.9-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
More information about the scm-commits
mailing list