Commit edba1f10 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[XFRM]: Fix OOPS in xfrm_state_update.

parent 41f0321d
...@@ -485,7 +485,8 @@ int xfrm_state_update(struct xfrm_state *x) ...@@ -485,7 +485,8 @@ int xfrm_state_update(struct xfrm_state *x)
err = -EINVAL; err = -EINVAL;
spin_lock_bh(&x1->lock); spin_lock_bh(&x1->lock);
if (likely(x1->km.state == XFRM_STATE_VALID)) { if (likely(x1->km.state == XFRM_STATE_VALID)) {
memcpy(x1->encap, x->encap, sizeof(*x1->encap)); if (x->encap && x1->encap)
memcpy(x1->encap, x->encap, sizeof(*x1->encap));
memcpy(&x1->lft, &x->lft, sizeof(x1->lft)); memcpy(&x1->lft, &x->lft, sizeof(x1->lft));
x1->km.dying = 0; x1->km.dying = 0;
err = 0; err = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment