[libcxx-commits] [PATCH] D154514: [libc++] Fix incorrect length check in std::basic_filebuf
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jul 5 08:28:38 PDT 2023
ldionne created this revision.
Herald added a project: All.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D154514
Files:
libcxx/include/fstream
libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp
libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp
libcxx/test/std/input.output/file.streams/fstreams/types.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154514.537364.patch
Type: text/x-patch
Size: 20616 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230705/56ebf24e/attachment-0001.bin>
More information about the libcxx-commits
mailing list