[HIDL][AWARE] Check for and fix corrupted char[] from legacy HAL
Check that char[] from legacy HAL are:
- Null terminated
- ASCII (truncate up-to first non-ASCII)
Bug: 37704662
Test: integration (sl4a) tests passing (up-to other issues)
Change-Id: I84cf09923594b3a5c0dfa5267edd844fb375c595
diff --git a/wifi/1.0/default/hidl_struct_util.h b/wifi/1.0/default/hidl_struct_util.h
index 41e97b3..c04d92f 100644
--- a/wifi/1.0/default/hidl_struct_util.h
+++ b/wifi/1.0/default/hidl_struct_util.h
@@ -94,7 +94,8 @@
std::vector<WifiDebugRxPacketFateReport>* hidl_fates);
// NAN iface conversion methods.
-NanStatusType convertLegacyNanStatusTypeToHidl(legacy_hal::NanStatusType type);
+void convertToWifiNanStatus(legacy_hal::NanStatusType type, const char* str, size_t max_len,
+ WifiNanStatus* wifiNanStatus);
bool convertHidlNanEnableRequestToLegacy(
const NanEnableRequest& hidl_request,
legacy_hal::NanEnableRequest* legacy_request);