[all-commits] [llvm/llvm-project] 33b9e7: [clang-tidy] Fix UB in SuspiciousIncludeCheck when...

Harlen Batagelo via All-commits all-commits at lists.llvm.org
Mon Apr 27 22:31:34 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 33b9e74a098e345f4a6c134d54299bde1b24b64b
      https://github.com/llvm/llvm-project/commit/33b9e74a098e345f4a6c134d54299bde1b24b64b
  Author: Harlen Batagelo <hbatagelo at gmail.com>
  Date:   2026-04-27 (Mon, 27 Apr 2026)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp

  Log Message:
  -----------
  [clang-tidy] Fix UB in SuspiciousIncludeCheck when IgnoredRegex is not set (#194521)

When the "IgnoredRegex" option is not set, `IgnoredRegexString` is
default-constructed, i.e. initialized with a null data pointer. This is
passed to `llvm_regcomp` as the pattern argument, causing a nullptr+0 UB
in regcomp.c (caught by UBSan). Fix by initializing
`IgnoredRegexString` with an empty string literal instead.



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