diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2006-04-04 21:51:05 +0200 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-04-10 07:25:22 +0200 |
commit | 8bf4b8a1083694d5aac292f92705ddd3aec29be6 (patch) | |
tree | a8bbf0bb32b7e286659eae12326c54671430560f /net | |
parent | [SELINUX] Fix build after ipsec decap state changes. (diff) | |
download | linux-8bf4b8a1083694d5aac292f92705ddd3aec29be6.tar.xz linux-8bf4b8a1083694d5aac292f92705ddd3aec29be6.zip |
[IPSEC]: Check x->encap before dereferencing it
We need to dereference x->encap before dereferencing it for encap_type.
If it's absent then the encap_type is zero.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/xfrm4_input.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c index e1b8f4b90d80..7a0b9524fe08 100644 --- a/net/ipv4/xfrm4_input.c +++ b/net/ipv4/xfrm4_input.c @@ -90,7 +90,7 @@ int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type) if (unlikely(x->km.state != XFRM_STATE_VALID)) goto drop_unlock; - if (x->encap->encap_type != encap_type) + if ((x->encap ? x->encap->encap_type : 0) != encap_type) goto drop_unlock; if (x->props.replay_window && xfrm_replay_check(x, seq)) |