[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200815165030.5849-1-ztong0001@gmail.com>
Date: Sat, 15 Aug 2020 12:50:30 -0400
From: Tong Zhang <ztong0001@...il.com>
To: pablo@...filter.org, kadlec@...filter.org, fw@...len.de,
davem@...emloft.net, kuba@...nel.org,
netfilter-devel@...r.kernel.org, coreteam@...filter.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: ztong0001@...il.com
Subject: [PATCH] netfilter: nf_conntrack_sip: fix parsing error
ct_sip_parse_numerical_param can only return 0 or 1, but the caller is
checking parsing error using < 0
Signed-off-by: Tong Zhang <ztong0001@...il.com>
---
net/netfilter/nf_conntrack_sip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index b83dc9bf0a5d..08873694120a 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -1269,7 +1269,7 @@ static int process_register_request(struct sk_buff *skb, unsigned int protoff,
if (ct_sip_parse_numerical_param(ct, *dptr,
matchoff + matchlen, *datalen,
- "expires=", NULL, NULL, &expires) < 0) {
+ "expires=", NULL, NULL, &expires) == 0) {
nf_ct_helper_log(skb, ct, "cannot parse expires");
return NF_DROP;
}
@@ -1375,7 +1375,7 @@ static int process_register_response(struct sk_buff *skb, unsigned int protoff,
matchoff + matchlen,
*datalen, "expires=",
NULL, NULL, &c_expires);
- if (ret < 0) {
+ if (ret == 0) {
nf_ct_helper_log(skb, ct, "cannot parse expires");
return NF_DROP;
}
--
2.25.1
Powered by blists - more mailing lists