[all-commits] [llvm/llvm-project] 5bb7ba: [analyzer] Detect use-after-free for field address...

LoboQ1ng via All-commits all-commits at lists.llvm.org
Fri Aug 8 11:49:11 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5bb7ba6222f7bdee30835c40f2c2bc9c98157c70
      https://github.com/llvm/llvm-project/commit/5bb7ba6222f7bdee30835c40f2c2bc9c98157c70
  Author: LoboQ1ng <xpess at qq.com>
  Date:   2025-08-08 (Fri, 08 Aug 2025)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
    A clang/test/Analysis/malloc-checker-arg-uaf.c

  Log Message:
  -----------
  [analyzer] Detect use-after-free for field address (e.g., &ptr->field) (#152462)

This patch improves MallocChecker to detect use-after-free bugs when
a freed structure's field is passed by address (e.g., `&ptr->field`).

Previously, MallocChecker would miss such cases, as it only checked the
top-level symbol of argument values.
This patch analyzes the base region of arguments and extracts the
symbolic region (if any), allowing UAF detection even for field address
expressions.

Fixes #152446



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