fix overflow bug when attempting to access match results

This commit is contained in:
Christian Mazakas
2024-12-20 11:11:31 -08:00
parent 7af2aadcb8
commit 093e135925
4 changed files with 36 additions and 0 deletions

View File

@ -227,6 +227,10 @@ public:
{
if(m_is_singular && m_subs.empty())
raise_logic_error();
if (sub >= INT_MAX - 2 )
return m_null;
sub += 2;
if(sub < (int)m_subs.size() && (sub >= 0))
{

View File

@ -19,6 +19,8 @@
#ifndef BOOST_REGEX_SYNTAX_TYPE_HPP
#define BOOST_REGEX_SYNTAX_TYPE_HPP
#include <boost/regex/config.hpp>
namespace boost{
namespace regex_constants{