[all-commits] [llvm/llvm-project] 574c5c: [libc++] Fix incorrect length check in std::basic_...

Louis Dionne via All-commits all-commits at lists.llvm.org
Fri Oct 27 07:22:17 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 574c5cc9d8f6fcdf3702f5f98ea07ea6a8ebdfb7
      https://github.com/llvm/llvm-project/commit/574c5cc9d8f6fcdf3702f5f98ea07ea6a8ebdfb7
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2023-10-27 (Fri, 27 Oct 2023)

  Changed paths:
    M libcxx/include/fstream
    A libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp
    A libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp
    A libcxx/test/std/input.output/file.streams/fstreams/types.h

  Log Message:
  -----------
  [libc++] Fix incorrect length check in std::basic_filebuf

This patch fixes an ASAN-found issue in std::basic_filebuf where we'd
check the wrong size before proceeding to set our internal buffer to
the externally-provided buffer, leading to the library trying to read
from the incorrect buffer in underflow().

Thanks to Andrey Semin for the patch.

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




More information about the All-commits mailing list