From ce5452cf78f96b924a11d02ad57b6b046b1e123a Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Fri, 8 Oct 2010 22:15:26 +0000 Subject: [PATCH] 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. --- lib/ofp-parse.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 7a888801e..e6af0362b 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -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) { -- 2.43.0