Fix a bug where string erases throws out of range (#6135)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
This commit is contained in:
@@ -300,7 +300,9 @@ bool PLY::Element::ParseElement(IOStreamBuffer<char> &streamBuffer, std::vector<
|
||||
// the original string identifier
|
||||
pOut->szName = std::string(&buffer[0], &buffer[0] + strlen(&buffer[0]));
|
||||
auto pos = pOut->szName.find_last_of(' ');
|
||||
pOut->szName.erase(pos, pOut->szName.size());
|
||||
if (pos != std::string::npos) {
|
||||
pOut->szName.erase(pos, pOut->szName.size());
|
||||
}
|
||||
}
|
||||
|
||||
if (!PLY::DOM::SkipSpaces(buffer))
|
||||
|
||||
Reference in New Issue
Block a user