[PATCH 2/5] netfilter: Fix format string mismatch in mangle_content_len()

Subsystems: netfilter, networking [general], the rest

STALE4511d

6 messages, 3 authors, 2014-04-29 · open the first message on its own page

[PATCH 2/5] netfilter: Fix format string mismatch in mangle_content_len()

From: Masanari Iida <hidden>
Date: 2014-03-31 15:43:51

Fix format string mismatch in mangle_connect_len()

Signed-off-by: Masanari Iida <redacted>
---
 net/netfilter/nf_nat_sip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nf_nat_sip.c b/net/netfilter/nf_nat_sip.c
index b4d691d..5f98845 100644
--- a/net/netfilter/nf_nat_sip.c
+++ b/net/netfilter/nf_nat_sip.c
@@ -434,7 +434,7 @@ static int mangle_content_len(struct sk_buff *skb, unsigned int protoff,
 			      &matchoff, &matchlen) <= 0)
 		return 0;
 
-	buflen = sprintf(buffer, "%u", c_len);
+	buflen = sprintf(buffer, "%d", c_len);
 	return mangle_packet(skb, protoff, dataoff, dptr, datalen,
 			     matchoff, matchlen, buffer, buflen);
 }
-- 
1.9.1.352.gd393d14

[PATCH 3/5] netfilter: Fix format string mismatch in _conntrack_tftp_init()

From: Masanari Iida <hidden>
Date: 2014-03-31 15:43:53

Fix format string mismatch in _conntrack_tftp_init().

Signed-off-by: Masanari Iida <redacted>
---
 net/netfilter/nf_conntrack_tftp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nf_conntrack_tftp.c b/net/netfilter/nf_conntrack_tftp.c
index e68ab4f..9b1608f 100644
--- a/net/netfilter/nf_conntrack_tftp.c
+++ b/net/netfilter/nf_conntrack_tftp.c
@@ -134,7 +134,7 @@ static int __init nf_conntrack_tftp_init(void)
 			if (ports[i] == TFTP_PORT)
 				sprintf(tftp[i][j].name, "tftp");
 			else
-				sprintf(tftp[i][j].name, "tftp-%u", i);
+				sprintf(tftp[i][j].name, "tftp-%d", i);
 
 			ret = nf_conntrack_helper_register(&tftp[i][j]);
 			if (ret) {
-- 
1.9.1.352.gd393d14

[PATCH 4/5] netfilter: Fix format string mismatch in nf_conntrack_irc_init()

From: Masanari Iida <hidden>
Date: 2014-03-31 15:43:56

Fix format string mismatch in nf_conntrack_irc_init()

Signed-off-by: Masanari Iida <redacted>
---
 net/netfilter/nf_conntrack_irc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c
index 0fd2976..8ee3a5f 100644
--- a/net/netfilter/nf_conntrack_irc.c
+++ b/net/netfilter/nf_conntrack_irc.c
@@ -263,7 +263,7 @@ static int __init nf_conntrack_irc_init(void)
 		if (ports[i] == IRC_PORT)
 			sprintf(irc[i].name, "irc");
 		else
-			sprintf(irc[i].name, "irc-%u", i);
+			sprintf(irc[i].name, "irc-%d", i);
 
 		ret = nf_conntrack_helper_register(&irc[i]);
 		if (ret) {
-- 
1.9.1.352.gd393d14

[PATCH 5/5] netfilter: Fix format string mismatch in nf_conntrack_sip_init()

From: Masanari Iida <hidden>
Date: 2014-03-31 15:43:57

Fix format string mismatch in nf_conntrack_sip_init().

Signed-off-by: Masanari Iida <redacted>
---
 net/netfilter/nf_conntrack_sip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index 4c3ba1c..ef82019 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -1659,7 +1659,7 @@ static int __init nf_conntrack_sip_init(void)
 			if (ports[i] == SIP_PORT)
 				sprintf(sip[i][j].name, "sip");
 			else
-				sprintf(sip[i][j].name, "sip-%u", i);
+				sprintf(sip[i][j].name, "sip-%d", i);
 
 			pr_debug("port #%u: %u\n", i, ports[i]);
 
-- 
1.9.1.352.gd393d14

Re: [PATCH 2/5] netfilter: Fix format string mismatch in mangle_content_len()

From: Patrick McHardy <hidden>
Date: 2014-04-29 14:21:49

On Tue, Apr 01, 2014 at 12:43:36AM +0900, Masanari Iida wrote:
Fix format string mismatch in mangle_connect_len()
All these patches seem like pointless noise to me. In none of these
cases can the value legitimately be negative. If anything, you should
fix the types to be unsigned.
quoted hunk
Signed-off-by: Masanari Iida <redacted>
---
 net/netfilter/nf_nat_sip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nf_nat_sip.c b/net/netfilter/nf_nat_sip.c
index b4d691d..5f98845 100644
--- a/net/netfilter/nf_nat_sip.c
+++ b/net/netfilter/nf_nat_sip.c
@@ -434,7 +434,7 @@ static int mangle_content_len(struct sk_buff *skb, unsigned int protoff,
 			      &matchoff, &matchlen) <= 0)
 		return 0;
 
-	buflen = sprintf(buffer, "%u", c_len);
+	buflen = sprintf(buffer, "%d", c_len);
 	return mangle_packet(skb, protoff, dataoff, dptr, datalen,
 			     matchoff, matchlen, buffer, buflen);
 }
-- 
1.9.1.352.gd393d14

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/5] netfilter: Fix format string mismatch in mangle_content_len()

From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: 2014-04-29 19:02:54

On Tue, Apr 29, 2014 at 03:21:21PM +0100, Patrick McHardy wrote:
On Tue, Apr 01, 2014 at 12:43:36AM +0900, Masanari Iida wrote:
quoted
Fix format string mismatch in mangle_connect_len()
All these patches seem like pointless noise to me. In none of these
cases can the value legitimately be negative. If anything, you should
fix the types to be unsigned.
Let's do that instead. I'm going to remove these oneliners from the
nf-next queue, thanks Patrick.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help