diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2015-08-24 15:57:09 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2015-08-24 15:57:09 +0000 |
commit | 70e8f5988476c4ef3f8d0296d03a1f97380de212 (patch) | |
tree | a3c508f148b85492972b7101ce4e8e09841edfb9 /include/regex | |
parent | bb2f28e15d3666b9316bf77ced071f16fa0fc70e (diff) | |
download | external_libcxx-70e8f5988476c4ef3f8d0296d03a1f97380de212.tar.gz external_libcxx-70e8f5988476c4ef3f8d0296d03a1f97380de212.tar.bz2 external_libcxx-70e8f5988476c4ef3f8d0296d03a1f97380de212.zip |
Fix a crasher found by libFuzzer
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@245849 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/regex')
-rw-r--r-- | include/regex | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/regex b/include/regex index b355bbb3a..b2b556e5b 100644 --- a/include/regex +++ b/include/regex @@ -1733,6 +1733,8 @@ template <class _CharT> void __back_ref<_CharT>::__exec(__state& __s) const { + if (__mexp_ > __s.__sub_matches_.size()) + __throw_regex_error<regex_constants::error_backref>(); sub_match<const _CharT*>& __sm = __s.__sub_matches_[__mexp_-1]; if (__sm.matched) { |