]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
pkt_sched: fix missing check for packet overrun in qdisc_dump_stab()
authorPatrick McHardy <kaber@trash.net>
Thu, 20 Nov 2008 12:07:14 +0000 (04:07 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Nov 2008 12:07:14 +0000 (04:07 -0800)
nla_nest_start() might return NULL, causing a NULL pointer dereference.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_api.c

index b16ad2972c6b527dc2013a5dfb4108ad35ef8197..6ab4a2f92ca0b390849547e8e93f99b07e6d4a6b 100644 (file)
@@ -417,6 +417,8 @@ static int qdisc_dump_stab(struct sk_buff *skb, struct qdisc_size_table *stab)
        struct nlattr *nest;
 
        nest = nla_nest_start(skb, TCA_STAB);
+       if (nest == NULL)
+               goto nla_put_failure;
        NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts);
        nla_nest_end(skb, nest);