[all-commits] [llvm/llvm-project] f393e1: [clangd] Fix UB in scanPreamble

kadir ├žetinkaya via All-commits all-commits at lists.llvm.org
Fri Feb 24 01:44:33 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f393e1f6b3b42e8f355e64e2fb479c571ab939bc
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2023-02-24 (Fri, 24 Feb 2023)

  Changed paths:
    M clang-tools-extra/clangd/Preamble.cpp

  Log Message:
  [clangd] Fix UB in scanPreamble

getMemBufferCopy triggers an UB when it receives a default constructed
StringRef. Make sure that we're always passing the null-terminated string
created in ParseInputs throughout the scanPreamble.

Differential Revision: https://reviews.llvm.org/D144708

More information about the All-commits mailing list