Don't crash when we have a .a file that contains an object with a 16 character name. Any calls to std::string::erase must be bounds checked.
<rdar://problem/22260988> llvm-svn: 244984
This commit is contained in:
parent
aa0d51f062
commit
1202881f9a
|
@ -105,7 +105,9 @@ ObjectContainerBSDArchive::Object::Extract (const DataExtractor& data, lldb::off
|
|||
{
|
||||
// Strip off any spaces (if the object file name contains spaces it
|
||||
// will use the extended format above).
|
||||
str.erase (str.find(' '));
|
||||
const size_t space_pos = str.find(' ');
|
||||
if (space_pos != std::string::npos)
|
||||
str.erase (space_pos);
|
||||
ar_name.SetCString(str.c_str());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue