From 1d87ef5cb22d4d1709af6b4d0460b0c3e2af9a22 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 23 Nov 2010 13:10:30 -0800 Subject: [PATCH] ofp-print: Fix handling of zero-length actions. Without this change, zero-length ofp_actions cause an infinite loop. --- lib/ofp-print.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ofp-print.c b/lib/ofp-print.c index e3cae7831..97fd0653d 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", -- 2.43.0