For function odp_nsh_hdr_from_attr, paramemter `attr` may not contain
all necessary OVS_NSH_KEY_ATTR_ to fully initialize data of nsh_hdr.
On return, nsh_hdr can contain uninitialized values in its fields.
This patch zeroes out nsh_hdr in the beginning in order to prevent it.
Reported-by: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10863
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
bool has_md1 = false;
bool has_md2 = false;
+ memset(nsh_hdr, 0, size);
+
NL_NESTED_FOR_EACH (a, left, attr) {
uint16_t type = nl_attr_type(a);
size_t len = nl_attr_get_size(a);