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 | 550dfe79ca8c3a2ec5fbf2e34ad40fe66eb7c09f (patch) | |
tree | e0b66d45dcc12eba2e8c38f0c854075b56226dfd /libcxx/include/regex | |
parent | db2f8a3cfdeb7cae5178bc84d185ec3765095a9d (diff) | |
download | bcm5719-llvm-550dfe79ca8c3a2ec5fbf2e34ad40fe66eb7c09f.tar.gz bcm5719-llvm-550dfe79ca8c3a2ec5fbf2e34ad40fe66eb7c09f.zip |
Fix a crasher found by libFuzzer
llvm-svn: 245849
Diffstat (limited to 'libcxx/include/regex')
-rw-r--r-- | libcxx/include/regex | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libcxx/include/regex b/libcxx/include/regex index b355bbb3ac4..b2b556e5bc4 100644 --- a/libcxx/include/regex +++ b/libcxx/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) { |