[Pkg-ofed-commits] [infiniband-diags] 06/07: Add patch to fix -Wformat-security errors.
Ana Beatriz Guerrero López
ana at moszumanska.debian.org
Wed Jul 22 19:52:14 UTC 2015
This is an automated email from the git hooks/post-receive script.
ana pushed a commit to branch master
in repository infiniband-diags.
commit 63c37af9493dff97bb58f27afd90e4d97806d22b
Author: Ana Guerrero López <ana at ekaia.org>
Date: Wed Jul 22 16:25:37 2015 +0200
Add patch to fix -Wformat-security errors.
---
debian/changelog | 1 +
.../0001-rdma-ndd-fix-compiler-warnings.patch | 46 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 48 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index c06579b..d82cb8e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ infiniband-diags (1.6.5-1) unstable; urgency=medium
to (>= 1.3.12).
* Add rdma-ndd support:
- Add build depends on libudev-dev.
+ - Add patch to fix -Wformat-security errors.
-- Ana Beatriz Guerrero Lopez <ana at debian.org> Wed, 22 Jul 2015 12:02:14 +0200
diff --git a/debian/patches/0001-rdma-ndd-fix-compiler-warnings.patch b/debian/patches/0001-rdma-ndd-fix-compiler-warnings.patch
new file mode 100644
index 0000000..b8abc90
--- /dev/null
+++ b/debian/patches/0001-rdma-ndd-fix-compiler-warnings.patch
@@ -0,0 +1,46 @@
+From cf7e16f278535e234dbf1968a41d63f824adf13e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ana=20Guerrero=20L=C3=B3pez?= <ana at ekaia.org>
+Date: Wed, 22 Jul 2015 14:50:48 +0200
+Subject: [PATCH] rdma-ndd: fix compiler warnings.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This patch fixes -Wformat-security warnings, that in Debian (and Ubuntu)
+are enabled by default:
+
+src/rdma-ndd.c: In function 'update_node_desc':
+src/rdma-ndd.c:149:3: error: format not a string literal and no format arguments [-Werror=format-security]
+ fprintf(f, new_nd);
+ ^
+src/rdma-ndd.c: In function 'udev_log_fn':
+src/rdma-ndd.c:247:2: error: format not a string literal and no format arguments [-Werror=format-security]
+ syslog(LOG_ERR, msg);
+
+Signed-off-by: Ana Guerrero López <ana at ekaia.org>
+---
+ src/rdma-ndd.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: infiniband-diags/src/rdma-ndd.c
+===================================================================
+--- infiniband-diags.orig/src/rdma-ndd.c
++++ infiniband-diags/src/rdma-ndd.c
+@@ -146,7 +146,7 @@ static int update_node_desc(const char *
+ syslog(LOG_INFO, "%s: change (%s) -> (%s)\n",
+ device, nd, new_nd);
+ rewind(f);
+- fprintf(f, new_nd);
++ fprintf(f, "%s", new_nd);
+ }
+
+ rc = 0;
+@@ -244,7 +244,7 @@ static void udev_log_fn(struct udev *ud,
+ file, line, fn);
+ if (off < MSG_MAX-1)
+ vsnprintf(msg+off, MSG_MAX-off, format, args);
+- syslog(LOG_ERR, msg);
++ syslog(LOG_ERR, "%s", msg);
+ }
+
+ static void setup_udev(void)
diff --git a/debian/patches/series b/debian/patches/series
index e613ac0..4c000ec 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
comment_test_out
+0001-rdma-ndd-fix-compiler-warnings.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/infiniband-diags.git
More information about the Pkg-ofed-commits
mailing list