Merge 53d8c57ee5afcf550df4e1c150309121ff77273d on remote branch
Change-Id: I03bcdbdea25c7f8d12999008f15a7259cd71c4ee
diff --git a/ipacm/src/IPACM_Config.cpp b/ipacm/src/IPACM_Config.cpp
index d8c4227..0decd1b 100644
--- a/ipacm/src/IPACM_Config.cpp
+++ b/ipacm/src/IPACM_Config.cpp
@@ -482,7 +482,7 @@
if (ipa_nat_iface_entries < ipa_num_ipa_interfaces)
{
- memcpy(pNatIfaces[ipa_nat_iface_entries - 1].iface_name,
+ strlcpy(pNatIfaces[ipa_nat_iface_entries - 1].iface_name,
dev_name, IPA_IFACE_NAME_LEN);
IPACMDBG_H("Add Nat IfaceName: %s ,update nat-ifaces number: %d\n",
diff --git a/ipacm/src/IPACM_Xml.cpp b/ipacm/src/IPACM_Xml.cpp
index 073dc98..120a638 100644
--- a/ipacm/src/IPACM_Xml.cpp
+++ b/ipacm/src/IPACM_Xml.cpp
@@ -267,8 +267,8 @@
{
str_size = strlen(content);
memset(content_buf, 0, sizeof(content_buf));
- memcpy(content_buf, (void *)content, str_size);
- strlcpy(config->iface_config.iface_entries[config->iface_config.num_iface_entries - 1].iface_name, content_buf, str_size+1);
+ strlcpy(content_buf, content, MAX_XML_STR_LEN);
+ strlcpy(config->iface_config.iface_entries[config->iface_config.num_iface_entries - 1].iface_name, content_buf, IPA_IFACE_NAME_LEN);
IPACMDBG_H("Name %s\n", config->iface_config.iface_entries[config->iface_config.num_iface_entries - 1].iface_name);
}
}