From: Patrick McHardy Date: Thu, 20 Nov 2008 12:07:14 +0000 (-0800) Subject: pkt_sched: fix missing check for packet overrun in qdisc_dump_stab() X-Git-Tag: v2.6.28-rc6~8^2~3 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=3aa4614da741f10b09559a5675c79e2eff5cccd8;p=linux-2.6-omap-h63xx.git pkt_sched: fix missing check for packet overrun in qdisc_dump_stab() nla_nest_start() might return NULL, causing a NULL pointer dereference. Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index b16ad2972c6..6ab4a2f92ca 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -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);