summaryrefslogtreecommitdiff
path: root/wifi/1.6/default/hidl_struct_util.cpp
diff options
context:
space:
mode:
authorGabriel Biren <gbiren@google.com>2022-03-31 00:08:02 +0000
committerGabriel Biren <gbiren@google.com>2022-03-31 00:10:29 +0000
commit11d4ab8f615496869c7f6455f103de6298ac127d (patch)
tree60f700766f28a6ee1b3740bfb2fd9a8bf27d6e13 /wifi/1.6/default/hidl_struct_util.cpp
parent89345a4d7da9c6a7b7ae43b4a2aedd3c0354ffff (diff)
Replace instances of strncpy and sprintf in the wifi
vendor HAL with strlcpy and snprintf. Bug: 218897284 Test: m Change-Id: I0a62d1c5043cabcf6a513b8b082ad1d7a1ea451c
Diffstat (limited to 'wifi/1.6/default/hidl_struct_util.cpp')
-rw-r--r--wifi/1.6/default/hidl_struct_util.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/wifi/1.6/default/hidl_struct_util.cpp b/wifi/1.6/default/hidl_struct_util.cpp
index 45459e2cd3..2112b260f3 100644
--- a/wifi/1.6/default/hidl_struct_util.cpp
+++ b/wifi/1.6/default/hidl_struct_util.cpp
@@ -1881,7 +1881,7 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy(
"ifaceName too long";
return false;
}
- strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1);
+ strlcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1);
legacy_request->ndp_cfg.security_cfg =
(hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN)
? legacy_hal::NAN_DP_CONFIG_SECURITY
@@ -1958,7 +1958,7 @@ bool convertHidlNanDataPathInitiatorRequest_1_6ToLegacy(
"ifaceName too long";
return false;
}
- strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1);
+ strlcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1);
legacy_request->ndp_cfg.security_cfg =
(hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN)
? legacy_hal::NAN_DP_CONFIG_SECURITY
@@ -2039,7 +2039,7 @@ bool convertHidlNanDataPathIndicationResponseToLegacy(
"ifaceName too long";
return false;
}
- strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1);
+ strlcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1);
legacy_request->ndp_cfg.security_cfg =
(hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN)
? legacy_hal::NAN_DP_CONFIG_SECURITY
@@ -2114,7 +2114,7 @@ bool convertHidlNanDataPathIndicationResponse_1_6ToLegacy(
"ifaceName too long";
return false;
}
- strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1);
+ strlcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1);
legacy_request->ndp_cfg.security_cfg =
(hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN)
? legacy_hal::NAN_DP_CONFIG_SECURITY