mirror of
https://github.com/darlinghq/darling-libcxx.git
synced 2024-11-23 11:59:52 +00:00
make sure that we don't call basic_streambuf::gbump with a value bigger than INT_MAX, since it only takes an int. Related to, but not quite the same as PR33725
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@308880 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bfa81b089c
commit
33e24e157e
@ -404,7 +404,8 @@ basic_streambuf<_CharT, _Traits>::xsgetn(char_type* __s, streamsize __n)
|
||||
{
|
||||
if (__ninp_ < __einp_)
|
||||
{
|
||||
const streamsize __len = _VSTD::min(__einp_ - __ninp_, __n - __i);
|
||||
const streamsize __len = _VSTD::min(static_cast<streamsize>(INT_MAX),
|
||||
_VSTD::min(__einp_ - __ninp_, __n - __i));
|
||||
traits_type::copy(__s, __ninp_, __len);
|
||||
__s += __len;
|
||||
__i += __len;
|
||||
|
Loading…
Reference in New Issue
Block a user