mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-12 21:56:54 +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 typeName;
|
||||||
std::string deleterName;
|
std::string deleterName;
|
||||||
|
|
||||||
size_t end = name.rfind('>') - 1;
|
size_t end = name.rfind('>');
|
||||||
size_t pos = end;
|
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;
|
size_t begin = 0;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user