Fix buffer read overflow in money_get::do_get(). Found by UBSan
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@177694 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
04bd79b23a
commit
9b145da078
@ -3359,7 +3359,7 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
||||
if (__neg)
|
||||
*__nc++ = '-';
|
||||
for (const char_type* __w = __wb.get(); __w < __wn; ++__w, ++__nc)
|
||||
*__nc = __src[find(__atoms, __atoms+sizeof(__atoms), *__w) - __atoms];
|
||||
*__nc = __src[find(__atoms, _VSTD::end(__atoms), *__w) - __atoms];
|
||||
*__nc = char();
|
||||
if (sscanf(__nbuf, "%Lf", &__v) != 1)
|
||||
__throw_runtime_error("money_get error");
|
||||
|
Loading…
Reference in New Issue
Block a user