Shifting a 16-bit signed int 16 bits is technically undefined behavior. This fixes the problem. (In practice this should be harmless in this case.)
Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9049 Signed-off-by: Ben Pfaff <b...@ovn.org> --- lib/ofp-actions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index e91e0b252390..607a947159cd 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -8902,7 +8902,8 @@ ofpact_hdrs_equal(const struct ofpact_hdrs *a, static uint32_t ofpact_hdrs_hash(const struct ofpact_hdrs *hdrs) { - return hash_2words(hdrs->vendor, (hdrs->type << 16) | hdrs->ofp_version); + return hash_2words(hdrs->vendor, + ((uint32_t) hdrs->type << 16) | hdrs->ofp_version); } #include "ofp-actions.inc2" -- 2.16.1 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev