Bug ID 19826
Summary ObjectContainerBSDArchive::Object::Extract() crashes if extracted file name is exactly 16 characters long
Product lldb
Version unspecified
Hardware All
OS All
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@cs.uiuc.edu
Reporter michaelwoerister@posteo.net
Classification Unclassified
The method ObjectContainerBSDArchive::Object::Extract() in
source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
crashes if the file name extracted from the header is exactly 16 bytes long.
The error is caused by the following piece of code:
// Strip off any spaces (if the object file name contains spaces it
// will use the extended format above).
str.erase (str.find(' '));
ar_name.SetCString(str.c_str());
The str.find(' ') call returns npos in this case (because there are no padding
spaces) which causes str.erase() to throw an exception, crashing LLDB.