Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9788
Fixes: 7333c3b1ce02 ("ofp-port: Fix buffer overread parsing Intel custom 
statistics.")
Signed-off-by: Ben Pfaff <b...@ovn.org>
---
 lib/ofp-port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ofp-port.c b/lib/ofp-port.c
index 2c812f8ecfa3..8d882a14b4df 100644
--- a/lib/ofp-port.c
+++ b/lib/ofp-port.c
@@ -1616,7 +1616,7 @@ parse_intel_port_custom_property(struct ofpbuf *payload,
 
         /* Counter name. */
         uint8_t *name_len = ofpbuf_try_pull(payload, sizeof *name_len);
-        char *name = ofpbuf_try_pull(payload, *name_len);
+        char *name = name_len ? ofpbuf_try_pull(payload, *name_len) : NULL;
         if (!name_len || !name) {
             return OFPERR_OFPBPC_BAD_LEN;
         }
-- 
2.16.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to