diff mbox series

[oe,meta-networking,3/7] ruli: FIx build with hardening flags

Message ID 20170626053446.37959-3-raj.khem@gmail.com
State Accepted
Commit bd259171ec0c2163a2c1025e1b83ae379cee96a7
Headers show
Series [oe,meta-oe,1/7] live555: Define XLOCALE_NOT_USED for glibc too | expand

Commit Message

Khem Raj June 26, 2017, 5:34 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...src-ruli_addr.c-Add-missing-format-string.patch | 35 ++++++++++++++++++++++
 meta-networking/recipes-support/ruli/ruli_0.36.bb  |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta-networking/recipes-support/ruli/files/0001-src-ruli_addr.c-Add-missing-format-string.patch

-- 
2.13.1

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-networking/recipes-support/ruli/files/0001-src-ruli_addr.c-Add-missing-format-string.patch b/meta-networking/recipes-support/ruli/files/0001-src-ruli_addr.c-Add-missing-format-string.patch
new file mode 100644
index 000000000..9044415ff
--- /dev/null
+++ b/meta-networking/recipes-support/ruli/files/0001-src-ruli_addr.c-Add-missing-format-string.patch
@@ -0,0 +1,35 @@ 
+From d3fb471f53712e710fb5777b1b0851c46b7be64c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 25 Jun 2017 01:23:03 -0700
+Subject: [PATCH] src/ruli_addr.c: Add missing format string
+
+fixes
+
+| ruli_addr.c: In function 'ruli_in_snprint':
+| ruli_addr.c:491:5: error: format not a string literal and no format arguments [-Werror=format-security]
+|      return snprintf(buf, size, inet_ntoa(addr->ipv4));
+|      ^~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/ruli_addr.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ruli_addr.c b/src/ruli_addr.c
+index f1eabae..5f1fd4f 100644
+--- a/src/ruli_addr.c
++++ b/src/ruli_addr.c
+@@ -488,7 +488,7 @@ int ruli_in_snprint(char *buf, size_t size, const _ruli_addr *addr, int family)
+ {
+   switch (family) {
+   case PF_INET:
+-    return snprintf(buf, size, inet_ntoa(addr->ipv4));
++    return snprintf(buf, size, "%s", inet_ntoa(addr->ipv4));
+ 
+   case PF_INET6:
+     return ruli_inet6_snprint(buf, size, &addr->ipv6);    
+-- 
+2.13.1
+
diff --git a/meta-networking/recipes-support/ruli/ruli_0.36.bb b/meta-networking/recipes-support/ruli/ruli_0.36.bb
index b41313090..885796d2a 100644
--- a/meta-networking/recipes-support/ruli/ruli_0.36.bb
+++ b/meta-networking/recipes-support/ruli/ruli_0.36.bb
@@ -10,6 +10,7 @@  DEPENDS = "liboop"
 SRC_URI = "http://download.savannah.gnu.org/releases/ruli/ruli_${PV}.orig.tar.gz \
            file://Makefile.patch \
            file://0001-Fix-build-with-format-string-checks.patch \
+           file://0001-src-ruli_addr.c-Add-missing-format-string.patch \
            "
 
 SRC_URI[md5sum] = "e73fbfdeadddb68a703a70cea5271468"