diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2016-12-24 17:21:03 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2016-12-24 17:21:03 +0000 |
commit | da520dcbeb84fef1acbcc2ba8b48a315dedf5464 (patch) | |
tree | 768c62e4181323f55e344778ec7829b0a060e4e0 /libcxx/include/regex | |
parent | 463c32eaf6d137f7b42f1189e8ce747ea35da2ae (diff) | |
download | bcm5719-llvm-da520dcbeb84fef1acbcc2ba8b48a315dedf5464.tar.gz bcm5719-llvm-da520dcbeb84fef1acbcc2ba8b48a315dedf5464.zip |
Fix bug #31387 - not checking end iterator when parsing decimal escape. Thanks to Karen for the report.
llvm-svn: 290500
Diffstat (limited to 'libcxx/include/regex')
-rw-r--r-- | libcxx/include/regex | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libcxx/include/regex b/libcxx/include/regex index 1c4cc1d9abb..5a6c7fbb8e0 100644 --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -4314,7 +4314,8 @@ basic_regex<_CharT, _Traits>::__parse_decimal_escape(_ForwardIterator __first, else if ('1' <= *__first && *__first <= '9') { unsigned __v = *__first - '0'; - for (++__first; '0' <= *__first && *__first <= '9'; ++__first) + for (++__first; + __first != __last && '0' <= *__first && *__first <= '9'; ++__first) __v = 10 * __v + *__first - '0'; if (__v > mark_count()) __throw_regex_error<regex_constants::error_backref>(); |