Compare commits

...

4 Commits

Author SHA1 Message Date
82a28cf859 Rework as esp-idf component 2023-11-23 17:17:05 +01:00
e5979ae1af Correct windows_gcc CI runner. 2022-06-27 09:14:55 +01:00
72f81888a5 Merge pull request #173 from boostorg/overflow_fix
Fix for numeric overflow found during fuzzing.
2022-04-08 17:22:08 +01:00
ae7819ddb1 Fix for numeric overflow found during fuzzing. 2022-04-06 17:52:09 +01:00
3 changed files with 22 additions and 1 deletions

View File

@ -158,7 +158,7 @@ jobs:
run: ../../../b2 toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }}
working-directory: ../boost-root/libs/regex/test
windows_gcc:
runs-on: windows-latest
runs-on: windows-2019
defaults:
run:
shell: cmd

View File

@ -3,6 +3,8 @@
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
if(NOT DEFINED IDF_TARGET)
# We support CMake 3.5, but prefer 3.16 policies and behavior
cmake_minimum_required(VERSION 3.5...3.16)
@ -67,3 +69,20 @@ if(ICU_FOUND)
endif()
else()
FILE(GLOB_RECURSE headers include/*.h include/*.hpp)
idf_component_register(
SRCS
${headers}
INCLUDE_DIRS
include
REQUIRES
boost_config
boost_throw_exception
boost_predef
boost_assert
)
endif()

View File

@ -1019,6 +1019,8 @@ int basic_regex_creator<charT, traits>::calculate_backstep(re_syntax_base* state
{
if(rep->max != rep->min)
return -1;
if (static_cast<std::size_t>((std::numeric_limits<int>::max)() - result) < rep->min)
return -1; // protection against overflow, we can't calculate a backstep in this case and the expression is probably ill-formed.
result += static_cast<int>(rep->min);
state = rep->alt.p;
continue;