Skip to content

LldbAdapter::GetTargetArchitecture crashes if SBPlatform::GetTriple returns nullptr #1096

@sentry

Description

@sentry

Sentry Issue: BINARYNINJA-BJ

EXCEPTION_ACCESS_VIOLATION_READ / 0x0: Fatal Error: EXCEPTION_ACCESS_VIOLATION_READ / 0x0
  File "xstring", line 415, in std::_Narrow_char_traits<T>::length
  File "xstring", line 2675, in std::basic_string<T>::{ctor}
  File "lldbadapter.cpp", line 1576, in BinaryNinjaDebugger::LldbAdapter::GetTargetArchitecture
  File "lldbadapter.cpp", line 1227, in BinaryNinjaDebugger::LldbAdapter::AddHardwareBreakpoint
  File "future", line 445, in std::_Associated_state<T>::_Delete_this
...
(20 additional frame(s) were not displayed)

@bdash says:

SBPlatform::GetTriple can return nullptr in some situations. It is undefined behavior to construct std::string with a const char* that is nullptr. On Windows it appears to crash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions