We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73cbd9c commit 8ae6839Copy full SHA for 8ae6839
1 file changed
src/runtime_src/core/edge/common_em/config.cxx
@@ -621,8 +621,9 @@ namespace xclemulation{
621
std::string mName = prop.second.get_value<std::string>();
622
if(mName.empty() == false)
623
{
624
- if(strlen(mName.c_str()) < 256)//info.mName is static array of size 256
625
- std::memcpy(info.mName, mName.c_str(), strlen(mName.c_str()) + 1);
+ const auto len = std::min(mName.size(), sizeof(info.mName) - 1);
+ std::memcpy(info.mName, mName.c_str(), len);
626
+ info.mName[len] = '\0';
627
}
628
629
else if(prop.first == "HalMajorVersion")
0 commit comments