From 40e57ca7178ea0c766df5baeb9136178ea3138b7 Mon Sep 17 00:00:00 2001 From: Alessandro Astone Date: Wed, 11 Nov 2020 18:41:30 +0100 Subject: [PATCH] wifi: Prevent returning an invalid factory MAC address This is the same error checking already done in wifi_ap_iface.cpp Change-Id: I2183e6ec13a15141dc638dc8d68fda6b3afa5aa4 --- wifi/1.4/default/wifi_sta_iface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wifi/1.4/default/wifi_sta_iface.cpp b/wifi/1.4/default/wifi_sta_iface.cpp index 49f383ae2f..bc6701d3ec 100644 --- a/wifi/1.4/default/wifi_sta_iface.cpp +++ b/wifi/1.4/default/wifi_sta_iface.cpp @@ -636,6 +636,10 @@ std::pair> WifiStaIface::getFactoryMacAddressInternal() { std::array mac = iface_util_.lock()->getFactoryMacAddress(ifname_); + if (mac[0] == 0 && mac[1] == 0 && mac[2] == 0 && mac[3] == 0 && + mac[4] == 0 && mac[5] == 0) { + return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), mac}; + } return {createWifiStatus(WifiStatusCode::SUCCESS), mac}; }