[all-commits] [llvm/llvm-project] c3a87d: [analyzer] CStringChecker should check the first b...

Balazs Benics via All-commits all-commits at lists.llvm.org
Mon Sep 11 05:21:43 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c3a87ddad62a6cc01acaccc76592bc6730c8ac3c
      https://github.com/llvm/llvm-project/commit/c3a87ddad62a6cc01acaccc76592bc6730c8ac3c
  Author: Balazs Benics <benicsbalazs at gmail.com>
  Date:   2023-09-11 (Mon, 11 Sep 2023)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
    M clang/test/Analysis/string.c

  Log Message:
  -----------
  [analyzer] CStringChecker should check the first byte of the destination of strcpy, strncpy

By not checking if the first byte of the destination of strcpy and
strncpy is writable, we missed some reports in the Juliet benchmark.

(Juliet CWE-124 Buffer Underwrite: strcpy, strncpy)
https://discourse.llvm.org/t/patches-inspired-by-the-juliet-benchmark/73106

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


  Commit: 0954dc3fb9214b994623f5306473de075f8e3593
      https://github.com/llvm/llvm-project/commit/0954dc3fb9214b994623f5306473de075f8e3593
  Author: Balazs Benics <benicsbalazs at gmail.com>
  Date:   2023-09-11 (Mon, 11 Sep 2023)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
    M clang/test/Analysis/string.c

  Log Message:
  -----------
  [analyzer] CStringChecker buffer access checks should check the first bytes

By not checking if the first byte of the buffer is accessible,
we missed some reports in the Juliet benchmark.

(Juliet CWE-124 Buffer Underwrite: memcpy, memmove)
https://discourse.llvm.org/t/patches-inspired-by-the-juliet-benchmark/73106

Depends on D159108

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


Compare: https://github.com/llvm/llvm-project/compare/4b9259b94704...0954dc3fb921


More information about the All-commits mailing list