projects
/
openvswitch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c31abb5
)
lib: ofp-parse segfaults if required argument isn't specified
author
Ethan Jackson
<ethan@nicira.com>
Fri, 8 Oct 2010 22:15:26 +0000
(22:15 +0000)
committer
Ethan Jackson
<ethan@nicira.com>
Mon, 11 Oct 2010 21:29:22 +0000
(21:29 +0000)
Running ovs-ofctl add-flow br0 "in_port=3 actions=resubmit" would
segfault instead of reporting an error.
lib/ofp-parse.c
patch
|
blob
|
history
diff --git
a/lib/ofp-parse.c
b/lib/ofp-parse.c
index 7a888801e7159043743f2baf244ef4a214e49178..e6af0362b62c33041e7ac2465cfa192834e561d8 100644
(file)
--- 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) {