Skip to content

Commit

Permalink
[APPLETALK]: Fix potential OOPS in atalk_sendmsg().
Browse files Browse the repository at this point in the history
atrtr_find() can return NULL, so do not blindly dereference
rt->dev before we check for rt being NULL.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Oct 30, 2006
1 parent d458fd8 commit 201a95a
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions net/appletalk/ddp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1584,15 +1584,13 @@ 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) {
rt = atrtr_find(&usat->sat_addr);
dev = rt->dev;
} else {
struct atalk_addr at_hint;

at_hint.s_node = 0;
at_hint.s_net = at->src_net;

rt = atrtr_find(&at_hint);
dev = rt->dev;
}
if (!rt)
return -ENETUNREACH;
Expand Down

0 comments on commit 201a95a

Please sign in to comment.