Fix #13574: Object selection crashes if 'originalId' missing

This commit is contained in:
Michael Steenbeek authored and GitHub committed 2020-12-23 20:12:25 +01:00
1 parent 8bab0c7479
commit 90964b38bb
2 files changed
+8

No files matched your search

+2
View File
@@ -450,6 +450,8 @@ namespace ObjectFactory
originalName = originalId.substr(9, 8);
entry.checksum = std::stoul(originalId.substr(18, 8), nullptr, 16);
}
// Always set, since originalId might be missing or incorrect.
entry.SetType(objectType);
auto minLength = std::min<size_t>(8, originalName.length());
std::memcpy(entry.name, originalName.c_str(), minLength);