mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-09 13:14:55 +00:00
Check bounds when processing unique_ptr
This commit is contained in:
parent
7cc7aa8882
commit
9047f69db4
@ -165,8 +165,13 @@ std::string OICodeGen::preProcessUniquePtr(drgn_type* type, std::string name) {
|
||||
std::string typeName;
|
||||
std::string deleterName;
|
||||
|
||||
size_t end = name.rfind('>') - 1;
|
||||
size_t pos = end;
|
||||
size_t end = name.rfind('>');
|
||||
if (end == std::string::npos) {
|
||||
LOG(ERROR) << "No template parameter for the unique_ptr " << type;
|
||||
return name;
|
||||
}
|
||||
|
||||
size_t pos = end = end - 1; // Skip the '>' found
|
||||
size_t begin = 0;
|
||||
bool found = false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user