In this test, the involved ovs functions expect valid ofputil_protocol values. Therefore, if usable_protocols is invalid, we should return. Otherwise, ovs will abort.
Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11165 Signed-off-by: Yifeng Sun <[email protected]> --- tests/oss-fuzz/ofctl_parse_target.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/oss-fuzz/ofctl_parse_target.c b/tests/oss-fuzz/ofctl_parse_target.c index fbd91bdd3e81..db86c7da1ab3 100644 --- a/tests/oss-fuzz/ofctl_parse_target.c +++ b/tests/oss-fuzz/ofctl_parse_target.c @@ -22,6 +22,7 @@ ofctl_parse_flows__(struct ofputil_flow_mod *fms, size_t n_fms, if (!(usable_protocols & OFPUTIL_P_ANY)) { printf("no usable protocol\n"); + return; } for (i = 0; i < sizeof(enum ofputil_protocol) * CHAR_BIT; i++) { protocol = 1u << i; -- 2.7.4 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
