Regex: Fix potential negation of INT_MIN,

see https://oss-fuzz.com/v2/testcase-detail/6646578892767232?noredirect=1.
This commit is contained in:
jzmaddock
2017-10-07 17:23:59 +01:00
parent 881a157243
commit f592693c9b

View File

@ -777,7 +777,7 @@ inline bool perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref(
{ {
// Have we recursed into subexpression "index"? // Have we recursed into subexpression "index"?
// If index == 0 then check for any recursion at all, otherwise for recursion to -index-1. // If index == 0 then check for any recursion at all, otherwise for recursion to -index-1.
int idx = -index-1; int idx = -(index+1);
if(idx >= 10000) if(idx >= 10000)
{ {
named_subexpressions::range_type r = re.get_data().equal_range(idx); named_subexpressions::range_type r = re.get_data().equal_range(idx);