wpa_supplicant(hidl): Return value for get driver commands
The return value for the |wpa_drv_driver_cmd| for getter commands
contains the length of the buffer filled up. Unlike the other methods in
supplicant, this should be checked for < 0 for errors.
Bug: 35844946
Test: Verified that the mac address is fetched correctly.
Change-Id: I4462442ffbb97ff02450b7bc871fb3780beb2c14
diff --git a/wpa_supplicant/hidl/sta_iface.cpp b/wpa_supplicant/hidl/sta_iface.cpp
index ee38088..8e5fa73 100644
--- a/wpa_supplicant/hidl/sta_iface.cpp
+++ b/wpa_supplicant/hidl/sta_iface.cpp
@@ -728,7 +728,7 @@
sizeof(driver_cmd_reply_buf));
// Reply is of the format: "Macaddr = XX:XX:XX:XX:XX:XX"
std::string reply_str = driver_cmd_reply_buf;
- if (ret || reply_str.empty() ||
+ if (ret < 0 || reply_str.empty() ||
reply_str.find("=") == std::string::npos) {
return {{SupplicantStatusCode::FAILURE_UNKNOWN, ""}, {}};
}