File openvswitch-CVE-2021-36980.patch of Package openvswitch.29019

diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index e2e829772a5..0342a228b70 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -4431,6 +4431,7 @@ decode_NXAST_RAW_ENCAP(const struct nx_action_encap *nae,
 {
     struct ofpact_encap *encap;
     const struct ofp_ed_prop_header *ofp_prop;
+    const size_t encap_ofs = out->size;
     size_t props_len;
     uint16_t n_props = 0;
     int err;
@@ -4458,6 +4459,7 @@ decode_NXAST_RAW_ENCAP(const struct nx_action_encap *nae,
         }
         n_props++;
     }
+    encap = ofpbuf_at_assert(out, encap_ofs, sizeof *encap);
     encap->n_props = n_props;
     out->header = &encap->ofpact;
     ofpact_finish_ENCAP(out, &encap);
openSUSE Build Service is sponsored by