提交 201a95af 编写于 作者: D David S. Miller

[APPLETALK]: Fix potential OOPS in atalk_sendmsg().

atrtr_find() can return NULL, so do not blindly dereference
rt->dev before we check for rt being NULL.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d458fd82
...@@ -1584,7 +1584,6 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr ...@@ -1584,7 +1584,6 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
if (usat->sat_addr.s_net || usat->sat_addr.s_node == ATADDR_ANYNODE) { if (usat->sat_addr.s_net || usat->sat_addr.s_node == ATADDR_ANYNODE) {
rt = atrtr_find(&usat->sat_addr); rt = atrtr_find(&usat->sat_addr);
dev = rt->dev;
} else { } else {
struct atalk_addr at_hint; struct atalk_addr at_hint;
...@@ -1592,7 +1591,6 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr ...@@ -1592,7 +1591,6 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
at_hint.s_net = at->src_net; at_hint.s_net = at->src_net;
rt = atrtr_find(&at_hint); rt = atrtr_find(&at_hint);
dev = rt->dev;
} }
if (!rt) if (!rt)
return -ENETUNREACH; return -ENETUNREACH;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册