summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/ruli/files/0001-Fix-build-with-format-string-checks.patch
blob: 8ca26b51bbbd7ea67c902c9b2ce3acee5bc9932f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 40848547abf592c8d29b85ef1346001514944435 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 17 Jun 2017 10:14:20 -0700
Subject: [PATCH] Fix build with format string checks

Fixes
| ruli_addr.c:418:5: error: format not a string literal and no format arguments [-Werror=format-security]
|      return fprintf(out, inet_ntoa(addr->ipv4));
|      ^~~~~~

Upstream-Status: Pending

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/ruli_addr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/src/ruli_addr.c
+++ b/src/ruli_addr.c
@@ -415,7 +415,7 @@ int ruli_in_print(FILE *out, const _ruli
 {
   switch (family) {
   case PF_INET:
-    return fprintf(out, inet_ntoa(addr->ipv4));
+    return fprintf(out, "%s", inet_ntoa(addr->ipv4));
 
   case PF_INET6:
     return ruli_inet6_print(out, &addr->ipv6);
--- a/sample/getaddrinfo.c
+++ b/sample/getaddrinfo.c
@@ -174,7 +174,7 @@ static void solve(const char *fullname)
 
       for (ai = ai_res; ai; ai = ai->ai_next) {
 
-	printf(fullname);
+	printf("%s", fullname);
 
 	switch (ai->ai_family) {
 	case PF_INET:
--- a/sample/ruli-getaddrinfo.c
+++ b/sample/ruli-getaddrinfo.c
@@ -176,7 +176,7 @@ static void solve(const char *fullname)
 
       for (ai = ai_res; ai; ai = ai->ai_next) {
 
-	printf(fullname);
+	printf("%s", fullname);
 
 	switch (ai->ai_family) {
 	case PF_INET: