mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
lib: added check to prevent int overflow
If enough large input is given ofpact_finish will fail. Implemented ofpbuf_oversized function to check for oversized buffer. Checks were added for parse functions and error messages returned. Basic manual testing performed. Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> Reported-by: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12972 Signed-off-by: Toms Atteka <cpp.code.lv@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -455,6 +455,11 @@ learn_parse__(char *orig, char *arg, const struct ofputil_port_map *port_map,
|
||||
learn = ofpacts->header;
|
||||
}
|
||||
}
|
||||
|
||||
if (ofpbuf_oversized(ofpacts)) {
|
||||
return xasprintf("input too big");
|
||||
}
|
||||
|
||||
ofpact_finish_LEARN(ofpacts, &learn);
|
||||
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user