Skip to content

Commit

Permalink
Don't potentially dereference NULL in net/dcb/dcbnl.c:dcbnl_getapp()
Browse files Browse the repository at this point in the history
nla_nest_start() may return NULL. If it does then we'll blow up in
nla_nest_end() when we dereference the pointer.

Signed-off-by: Jesper Juhl <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jjuhl authored and davem330 committed Feb 13, 2011
1 parent 7ec7927 commit d3337de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/dcb/dcbnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,9 @@ static int dcbnl_getapp(struct net_device *netdev, struct nlattr **tb,
dcb->cmd = DCB_CMD_GAPP;

app_nest = nla_nest_start(dcbnl_skb, DCB_ATTR_APP);
if (!app_nest)
goto out_cancel;

ret = nla_put_u8(dcbnl_skb, DCB_APP_ATTR_IDTYPE, idtype);
if (ret)
goto out_cancel;
Expand Down

0 comments on commit d3337de

Please sign in to comment.