Skip to content

Commit

Permalink
meta-flow: Make mf_vl_mff_mf_from_nxm_header() require a valid field.
Browse files Browse the repository at this point in the history
All the users of mf_vl_mff_mf_from_nxm_header() expect it to always obtain
a valid field or to report an error.  In practice, it did not report an
error in the case where the field was unknown (although it did report an
error in some other cases).  This commit fixes the problem.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9652
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
  • Loading branch information
blp committed Aug 3, 2018
1 parent b9a0c86 commit 68c814e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/meta-flow.c
Expand Up @@ -2907,7 +2907,9 @@ mf_vl_mff_mf_from_nxm_header(uint32_t header,
uint64_t *tlv_bitmap)
{
*field = mf_from_nxm_header(header, vl_mff_map);
if (mf_vl_mff_invalid(*field, vl_mff_map)) {
if (!*field) {
return OFPERR_OFPBAC_BAD_SET_TYPE;
} else if (mf_vl_mff_invalid(*field, vl_mff_map)) {
return OFPERR_NXFMFC_INVALID_TLV_FIELD;
}

Expand Down

0 comments on commit 68c814e

Please sign in to comment.