[all-commits] [llvm/llvm-project] c38a70: [lldb] Bound DataExtractor::PeekCStr to the data i...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Fri Sep 18 21:28:15 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c38a7054a1d889d428a24481f699927a8707b28e
      https://github.com/llvm/llvm-project/commit/c38a7054a1d889d428a24481f699927a8707b28e
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2026-09-18 (Fri, 18 Sep 2026)

  Changed paths:
    M lldb/include/lldb/Utility/DataExtractor.h
    M lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
    M lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
    M lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
    M lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    M lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
    M lldb/source/Utility/DataExtractor.cpp
    M lldb/source/ValueObject/ValueObject.cpp
    A lldb/test/Shell/ObjectFile/MachO/unterminated-symbol-name.yaml
    M lldb/unittests/Utility/DataExtractorTest.cpp

  Log Message:
  -----------
  [lldb] Bound DataExtractor::PeekCStr to the data it reads from (#224452)

PeekCStr only validated the first byte without checking for a terminator.
Every caller then treated the result as a C string, so an unterminated
string table let strlen run past the mapping, causing a crash or
security bug.

Return an optional StringRef, produced only when the terminator lies
within the data. The length comes along with it, so callers no longer
rescan, and an absent string stays distinct from an empty one.

ValueObject was the only caller that wanted an unterminated buffer. It
scans fixed size chunks of inferior memory, so it now asks for bytes with
PeekData and bounds its own scan.

rdar://186891223



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list