diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2017-07-24 14:05:10 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2017-07-24 14:05:10 +0000 |
| commit | e5cc2fcc9037b5eab7cb5250915002171f41d137 (patch) | |
| tree | 4a2e3e3a5cf59f053148729e37acb35ab1917e4e | |
| parent | 7d31878674c6a8ffe7d8122f11aa139c0b5efe93 (diff) | |
| download | bcm5719-llvm-e5cc2fcc9037b5eab7cb5250915002171f41d137.tar.gz bcm5719-llvm-e5cc2fcc9037b5eab7cb5250915002171f41d137.zip | |
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
llvm-svn: 308880
| -rw-r--r-- | libcxx/include/streambuf | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libcxx/include/streambuf b/libcxx/include/streambuf index a10ce1bf563..f6182d64fe6 100644 --- a/libcxx/include/streambuf +++ b/libcxx/include/streambuf @@ -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; |

