[lldb-dev] [Bug 19826] New: ObjectContainerBSDArchive::Object::Extract() crashes if extracted file name is exactly 16 characters long

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 22 05:17:45 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19826

            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 at cs.uiuc.edu
          Reporter: michaelwoerister at 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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140522/738c2658/attachment.html>


More information about the lldb-dev mailing list