From c13aaf7a94b213b74df2712c4f9a66be270cb3b6 Mon Sep 17 00:00:00 2001 From: wurui Date: Tue, 21 May 2024 11:45:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dmac=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E5=AF=BC=E8=87=B4=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wurui --- core/connection/wifi_direct_cpp/adapter/p2p_adapter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/connection/wifi_direct_cpp/adapter/p2p_adapter.cpp b/core/connection/wifi_direct_cpp/adapter/p2p_adapter.cpp index a88816143..497e932a8 100644 --- a/core/connection/wifi_direct_cpp/adapter/p2p_adapter.cpp +++ b/core/connection/wifi_direct_cpp/adapter/p2p_adapter.cpp @@ -380,6 +380,10 @@ int32_t P2pAdapter::GetDynamicMacAddress(std::string &macString) int32_t P2pAdapter::RequestGcIp(const std::string &macString, std::string &ipString) { + if (macString.size() == 0) { + CONN_LOGE(CONN_WIFI_DIRECT, "mac is empty"); + return SOFTBUS_INVALID_PARAM; + } std::vector macArray = WifiDirectUtils::MacStringToArray(macString); uint32_t ipArray[IPV4_ADDR_ARRAY_LEN];