From b0a83dc8d9a89f652fa11d4edc2178451e808ee5 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 21 Feb 2017 11:04:26 +0000 Subject: [PATCH] de-fuzz: fix overflow in shift --- include/boost/regex/v4/basic_regex_creator.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/regex/v4/basic_regex_creator.hpp b/include/boost/regex/v4/basic_regex_creator.hpp index 45539efd..7ee47b3f 100644 --- a/include/boost/regex/v4/basic_regex_creator.hpp +++ b/include/boost/regex/v4/basic_regex_creator.hpp @@ -1427,7 +1427,7 @@ bool basic_regex_creator::is_bad_repeat(re_syntax_base* pt) case syntax_element_long_set_rep: { unsigned state_id = static_cast(pt)->state_id; - if(state_id > sizeof(m_bad_repeats) * CHAR_BIT) + if(state_id >= sizeof(m_bad_repeats) * CHAR_BIT) return true; // run out of bits, assume we can't traverse this one. static const boost::uintmax_t one = 1uL; return m_bad_repeats & (one << state_id);