提交 ed0f160a 编写于 作者: D Dan Carpenter 提交者: David S. Miller

ipmr: off by one in __ipmr_fill_mroute()

This fixes a smatch warning:
	net/ipv4/ipmr.c +1917 __ipmr_fill_mroute(12) error: buffer overflow
	'(mrt)->vif_table' 32 <= 32

The ipv6 version had the same issue.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d938a702
...@@ -1911,7 +1911,7 @@ static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb, ...@@ -1911,7 +1911,7 @@ static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
struct rtattr *mp_head; struct rtattr *mp_head;
/* If cache is unresolved, don't try to parse IIF and OIF */ /* If cache is unresolved, don't try to parse IIF and OIF */
if (c->mfc_parent > MAXVIFS) if (c->mfc_parent >= MAXVIFS)
return -ENOENT; return -ENOENT;
if (VIF_EXISTS(mrt, c->mfc_parent)) if (VIF_EXISTS(mrt, c->mfc_parent))
......
...@@ -2017,7 +2017,7 @@ static int __ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb, ...@@ -2017,7 +2017,7 @@ static int __ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
struct rtattr *mp_head; struct rtattr *mp_head;
/* If cache is unresolved, don't try to parse IIF and OIF */ /* If cache is unresolved, don't try to parse IIF and OIF */
if (c->mf6c_parent > MAXMIFS) if (c->mf6c_parent >= MAXMIFS)
return -ENOENT; return -ENOENT;
if (MIF_EXISTS(mrt, c->mf6c_parent)) if (MIF_EXISTS(mrt, c->mf6c_parent))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册