de-fuzz: Prevent excessive left shifts

This commit is contained in:
jzmaddock
2017-02-22 12:52:53 +00:00
parent 3d2dc325de
commit 2e7e73aecf

View File

@ -902,7 +902,7 @@ escape_type_class_jump:
}
if(negative)
i = 1 + m_mark_count - i;
if(((i > 0) && (i < std::numeric_limits<unsigned>::digits) && (this->m_backrefs & (1u << (i-1)))) || ((i > 10000) && (this->m_pdata->get_id(i) > 0) && (this->m_backrefs & (1u << (this->m_pdata->get_id(i)-1)))))
if(((i > 0) && (i < std::numeric_limits<unsigned>::digits) && (i - 1 < sizeof(unsigned) * CHAR_BIT) && (this->m_backrefs & (1u << (i-1)))) || ((i > 10000) && (this->m_pdata->get_id(i) > 0) && (this->m_pdata->get_id(i)-1 < sizeof(unsigned) * CHAR_BIT) && (this->m_backrefs & (1u << (this->m_pdata->get_id(i)-1)))))
{
m_position = pc;
re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_backref, sizeof(re_brace)));