Skip to content

Commit

Permalink
[NETFILTER]: nfnetlink_queue: fix possible NULL-ptr dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Mar 13, 2006
1 parent 57ddd5c commit 406dbfc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/netfilter/nfnetlink_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit 406dbfc

Please sign in to comment.