[all-commits] [llvm/llvm-project] beeb37: [sanitizer] scanf interceptor: fix write size for ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Aug 27 22:19:44 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: beeb37a8f3275281be305d2d1afe35ca053e21c0
      https://github.com/llvm/llvm-project/commit/beeb37a8f3275281be305d2d1afe35ca053e21c0
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-08-27 (Sun, 27 Aug 2023)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_format.inc
    M compiler-rt/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cpp

  Log Message:
  -----------
  [sanitizer] scanf interceptor: fix write size for %mc/%mC/%mS

When the optional assignment-allocation character 'm' (Extension to the
ISO C standard) is present, we currently use internal_strlen(buf)+1 for
all of cCsS[ (D85350). Fix cCS to use the correct size.

Fix https://github.com/llvm/llvm-project/issues/61768

Reviewed By: #sanitizers, vitalybuka

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




More information about the All-commits mailing list