From 70e8f5988476c4ef3f8d0296d03a1f97380de212 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 24 Aug 2015 15:57:09 +0000 Subject: Fix a crasher found by libFuzzer git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@245849 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/regex | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/regex') diff --git a/include/regex b/include/regex index b355bbb3a..b2b556e5b 100644 --- a/include/regex +++ b/include/regex @@ -1733,6 +1733,8 @@ template void __back_ref<_CharT>::__exec(__state& __s) const { + if (__mexp_ > __s.__sub_matches_.size()) + __throw_regex_error(); sub_match& __sm = __s.__sub_matches_[__mexp_-1]; if (__sm.matched) { -- cgit v1.2.3