[ovs-dev] [PATCH ovn] pinctrl: Fix possible use of uninitialized eth address.

Ilya Maximets i.maximets at ovn.org
Thu May 14 10:53:22 UTC 2020


Not sure if this could happen in a real usecase, but below loop
over mac addresses could never reach initialization of 'ea'.

In this case it will be used uninitialized by the later code.
Setting it to zero ethernet address to avoid that condition.

Fixes: e3a398e9146e ("controller: Add ipv6 prefix delegation state machine")
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
---
 controller/pinctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/controller/pinctrl.c b/controller/pinctrl.c
index 103198282..bea446c89 100644
--- a/controller/pinctrl.c
+++ b/controller/pinctrl.c
@@ -1184,7 +1184,7 @@ prepare_ipv6_prefixd(struct ovsdb_idl_txn *ovnsb_idl_txn,
             }
 
             struct in6_addr ip6_addr;
-            struct eth_addr ea;
+            struct eth_addr ea = eth_addr_zero;
             for (j = 0; j < pb->n_mac; j++) {
                 struct lport_addresses laddrs;
 
-- 
2.25.4



More information about the dev mailing list