It appears that an issue existed in the count_common_prefix_run()
function from the beginning. This problem came to light while
addressing 'Dead assignment' warnings identified by the Clang
static analyzer.

Instead of updating the extra_prefix_len with the current (next)
value, the next value was inadvertently updated with extra_prefix_len.
This patch rectifies this behavior.

Fixes: 95a5454c5110 ("ofp-print: Abbreviate lists of fields in table features 
output.")
Signed-off-by: Eelco Chaudron <[email protected]>
---
 lib/ofp-table.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ofp-table.c b/lib/ofp-table.c
index a956754f2..f9bd3b7f9 100644
--- a/lib/ofp-table.c
+++ b/lib/ofp-table.c
@@ -1416,7 +1416,7 @@ count_common_prefix_run(const char *ids[], size_t n,
         if (!next) {
             break;
         } else if (next < extra_prefix_len) {
-            next = extra_prefix_len;
+            extra_prefix_len = next;
         }
         i++;
     }

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to