Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/runtime_src/core/common/drv/xrt_cu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,12 +1058,15 @@ ssize_t show_cu_info(struct xrt_cu *xcu, char *buf)
sz += scnprintf(buf+sz, PAGE_SIZE - sz, "Number of arguments: %d\n",
info->num_args);
for (i = 0; i < info->num_args; i++) {
if (info->args[i].dir == DIR_INPUT)
strcpy(dir, "input");
else if (info->args[i].dir == DIR_OUTPUT)
strcpy(dir, "output");
else
strcpy(dir, "unknown");
if (info->args[i].dir == DIR_INPUT) {
memcpy(dir, "input", strlen("input") + 1);
}
else if (info->args[i].dir == DIR_OUTPUT) {
memcpy(dir, "output", strlen("output") + 1);
}
else {
memcpy(dir, "unknown", strlen("unknown") + 1);
}

sz += scnprintf(buf+sz, PAGE_SIZE - sz, "arg name: %s\n",
info->args[i].name);
Expand Down
5 changes: 3 additions & 2 deletions src/runtime_src/core/edge/common_em/config.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,9 @@ namespace xclemulation{
std::string mName = prop.second.get_value<std::string>();
if(mName.empty() == false)
{
if(strlen(mName.c_str()) < 256)//info.mName is static array of size 256
std::strcpy(info.mName, mName.c_str());
const auto len = std::min(mName.size(), sizeof(info.mName) - 1);
std::memcpy(info.mName, mName.c_str(), len);
info.mName[len] = '\0';
}
}
else if(prop.first == "HalMajorVersion")
Expand Down
Loading