From df4eeb2030785e314fddcdc9fef87644b67c0149 Mon Sep 17 00:00:00 2001 From: Jarno Rajahalme Date: Fri, 6 Dec 2013 08:30:17 -0800 Subject: [PATCH 1/1] lib/odp-util: Only use expected_bit when set. parse_l2_5_onward() previously used out of range 'expected_bit' when it was called with no attrs, which happens when parsing a mask with zero length. Signed-off-by: Jarno Rajahalme Acked-by: Ben Pfaff --- lib/odp-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/odp-util.c b/lib/odp-util.c index 0fd1c5159..6dbc213c2 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -2871,7 +2871,7 @@ parse_l2_5_onward(const struct nlattr *attrs[OVS_KEY_ATTR_MAX + 1], } else { goto done; } - if (is_mask) { + if (check_len > 0) { /* Happens only when 'is_mask'. */ if (!is_all_zeros(check_start, check_len) && flow->dl_type != htons(0xffff)) { return ODP_FIT_ERROR; -- 2.43.0