projects
/
openvswitch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2cb9df
)
ofp-print: Fix handling of zero-length actions.
author
Ben Pfaff
<blp@nicira.com>
Tue, 23 Nov 2010 21:10:30 +0000
(13:10 -0800)
committer
Ben Pfaff
<blp@nicira.com>
Thu, 2 Dec 2010 22:57:58 +0000
(14:57 -0800)
Without this change, zero-length ofp_actions cause an infinite loop.
lib/ofp-print.c
patch
|
blob
|
history
diff --git
a/lib/ofp-print.c
b/lib/ofp-print.c
index e3cae783168d83b0c1d73e75964e1e14f4817d02..97fd0653d8c3ae5212420e3c35c03d1903fc2b00 100644
(file)
--- a/
lib/ofp-print.c
+++ b/
lib/ofp-print.c
@@
-314,6
+314,11
@@
ofp_print_action(struct ds *string, const struct ofp_action_header *ah,
return -1;
}
+ if (!len) {
+ ds_put_format(string, "***zero-length action***\n");
+ return 8;
+ }
+
if ((len % OFP_ACTION_ALIGN) != 0) {
ds_put_format(string,
"***action %"PRIu16" length not a multiple of %d***\n",