From f592693c9b50765a4db421d53b6e2e04c45a2ee6 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 7 Oct 2017 17:23:59 +0100 Subject: [PATCH] Regex: Fix potential negation of INT_MIN, see https://oss-fuzz.com/v2/testcase-detail/6646578892767232?noredirect=1. --- include/boost/regex/v4/perl_matcher_common.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/regex/v4/perl_matcher_common.hpp b/include/boost/regex/v4/perl_matcher_common.hpp index f08e9d43..a0973da9 100644 --- a/include/boost/regex/v4/perl_matcher_common.hpp +++ b/include/boost/regex/v4/perl_matcher_common.hpp @@ -777,7 +777,7 @@ inline bool perl_matcher::match_assert_backref( { // Have we recursed into subexpression "index"? // 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) { named_subexpressions::range_type r = re.get_data().equal_range(idx);