diff options
author | Patrick McHardy <kaber@trash.net> | 2006-03-12 23:32:47 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-03-12 23:39:35 -0500 |
commit | 406dbfc9ae0e6b7eb4da4a52c0a6556a0d7e6a2f (patch) | |
tree | 208366b1977eca0f2abad59e1c608fbf50fcbb21 /net | |
parent | 57ddd5c1803859d977c5a31a267d2c805ffe6e11 (diff) |
[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 cac38b2e147a..2cf5fb8322c4 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, | |||
928 | 928 | ||
929 | if (nfqa[NFQA_CFG_PARAMS-1]) { | 929 | if (nfqa[NFQA_CFG_PARAMS-1]) { |
930 | struct nfqnl_msg_config_params *params; | 930 | struct nfqnl_msg_config_params *params; |
931 | params = NFA_DATA(nfqa[NFQA_CFG_PARAMS-1]); | ||
932 | 931 | ||
932 | if (!queue) { | ||
933 | ret = -ENOENT; | ||
934 | goto out_put; | ||
935 | } | ||
936 | params = NFA_DATA(nfqa[NFQA_CFG_PARAMS-1]); | ||
933 | nfqnl_set_mode(queue, params->copy_mode, | 937 | nfqnl_set_mode(queue, params->copy_mode, |
934 | ntohl(params->copy_range)); | 938 | ntohl(params->copy_range)); |
935 | } | 939 | } |