From: Ben Pfaff Date: Tue, 23 Nov 2010 21:10:30 +0000 (-0800) Subject: ofp-print: Fix handling of zero-length actions. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d87ef5cb22d4d1709af6b4d0460b0c3e2af9a22;p=openvswitch ofp-print: Fix handling of zero-length actions. Without this change, zero-length ofp_actions cause an infinite loop. --- diff --git a/lib/ofp-print.c b/lib/ofp-print.c index e3cae783..97fd0653 100644 --- 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",