diff mbox

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

Message ID 1396280619-31152-1-git-send-email-standby24x7@gmail.com
State Not Applicable
Headers show

Commit Message

Masanari Iida March 31, 2014, 3:43 p.m. UTC
Fix format string mismatch in mangle_connect_len()

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
---
 net/netfilter/nf_nat_sip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pablo Neira Ayuso April 23, 2014, 12:22 p.m. UTC | #1
On Tue, Apr 01, 2014 at 12:43:36AM +0900, Masanari Iida wrote:
> Fix format string mismatch in mangle_connect_len()

Applied, thanks.

P.S: No need to CC linux-kernel and netdev, netfilter-devel is just
fine for these small changes.
--
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
Patrick McHardy April 29, 2014, 2:21 p.m. UTC | #2
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.

> 
> Signed-off-by: Masanari Iida <standby24x7@gmail.com>
> ---
>  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
--
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
Pablo Neira Ayuso April 29, 2014, 7:02 p.m. UTC | #3
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:
> > 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.
--
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
diff mbox

Patch

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);
 }