diff options
author | Patrick McHardy <kaber@trash.net> | 2006-03-12 20:32:47 -0800 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-03-12 20:39:35 -0800 |
commit | 406dbfc9ae0e6b7eb4da4a52c0a6556a0d7e6a2f (patch) | |
tree | 208366b1977eca0f2abad59e1c608fbf50fcbb21 /net | |
parent | 57ddd5c1803859d977c5a31a267d2c805ffe6e11 (diff) | |
download | op-kernel-dev-406dbfc9ae0e6b7eb4da4a52c0a6556a0d7e6a2f.zip op-kernel-dev-406dbfc9ae0e6b7eb4da4a52c0a6556a0d7e6a2f.tar.gz |
[NETFILTER]: nfnetlink_queue: fix possible NULL-ptr dereference
Fix NULL-ptr dereference when a config message for a non-existant
queue containing only an NFQA_CFG_PARAMS attribute is received.
Coverity #433
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nfnetlink_queue.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index cac38b2e..2cf5fb8 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c @@ -928,8 +928,12 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb, if (nfqa[NFQA_CFG_PARAMS-1]) { struct nfqnl_msg_config_params *params; - params = NFA_DATA(nfqa[NFQA_CFG_PARAMS-1]); + if (!queue) { + ret = -ENOENT; + goto out_put; + } + params = NFA_DATA(nfqa[NFQA_CFG_PARAMS-1]); nfqnl_set_mode(queue, params->copy_mode, ntohl(params->copy_range)); } |