diff --git a/data-ipa-cfg-mgr/ipacm/src/IPACM_Config.cpp b/data-ipa-cfg-mgr/ipacm/src/IPACM_Config.cpp index d8c4227..0decd1b 100644 --- a/data-ipa-cfg-mgr/ipacm/src/IPACM_Config.cpp +++ b/data-ipa-cfg-mgr/ipacm/src/IPACM_Config.cpp @@ -482,7 +482,7 @@ int IPACM_Config::AddNatIfaces(char *dev_name) 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/data-ipa-cfg-mgr/ipacm/src/IPACM_Xml.cpp b/data-ipa-cfg-mgr/ipacm/src/IPACM_Xml.cpp index 073dc98..120a638 100644 --- a/data-ipa-cfg-mgr/ipacm/src/IPACM_Xml.cpp +++ b/data-ipa-cfg-mgr/ipacm/src/IPACM_Xml.cpp @@ -267,8 +267,8 @@ static int ipacm_cfg_xml_parse_tree { 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); } }