mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
lib: ofp-parse segfaults if required argument isn't specified
Running ovs-ofctl add-flow br0 "in_port=3 actions=resubmit" would segfault instead of reporting an error.
This commit is contained in:
@@ -40,6 +40,10 @@ str_to_u32(const char *str)
|
||||
char *tail;
|
||||
uint32_t value;
|
||||
|
||||
if (!str) {
|
||||
ovs_fatal(0, "missing required numeric argument");
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
value = strtoul(str, &tail, 0);
|
||||
if (errno == EINVAL || errno == ERANGE || *tail) {
|
||||
|
Reference in New Issue
Block a user