diff --git a/backport-Disallow-repeating-a-case-change-group.patch b/backport-Disallow-repeating-a-case-change-group.patch new file mode 100644 index 0000000000000000000000000000000000000000..c7ec8140925dce2079ee0d7496ac8ab6988bba53 --- /dev/null +++ b/backport-Disallow-repeating-a-case-change-group.patch @@ -0,0 +1,42 @@ +From 370afe3f446c69a7ccc4c09f056272346afc264b Mon Sep 17 00:00:00 2001 +From: zhangyiru +Date: Thu, 14 Oct 2021 15:55:56 -0400 +Subject: [PATCH] Disallow repeating a case-change group + +fix assertion failed: https://github.com/boostorg/regex/issues/151 + +Signed-off-by: zhangyiru +--- + boost/regex/v4/basic_regex_parser.hpp | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/boost/regex/v4/basic_regex_parser.hpp b/boost/regex/v4/basic_regex_parser.hpp +index 6c7065f05..2ce615943 100644 +--- a/boost/regex/v4/basic_regex_parser.hpp ++++ b/boost/regex/v4/basic_regex_parser.hpp +@@ -1042,6 +1042,7 @@ bool basic_regex_parser::parse_repeat(std::size_t low, std::size_ + case syntax_element_jump: + case syntax_element_startmark: + case syntax_element_backstep: ++ case syntax_element_toggle_case: + // can't legally repeat any of the above: + fail(regex_constants::error_badrepeat, m_position - m_base); + return false; +@@ -3116,7 +3117,13 @@ bool basic_regex_parser::unwind_alts(std::ptrdiff_t last_paren_st + m_alt_jumps.pop_back(); + this->m_pdata->m_data.align(); + re_jump* jmp = static_cast(this->getaddress(jump_offset)); +- BOOST_ASSERT(jmp->type == syntax_element_jump); ++ if (jmp->type != syntax_element_jump) ++ { ++ // Something really bad happened, this used to be an assert, ++ // but we'll make it an error just in case we should ever get here. ++ fail(regex_constants::error_unknown, this->m_position - this->m_base, "Internal logic failed while compiling the expression, probably you added a repeat to something non-repeatable!"); ++ return false; ++ } + jmp->alt.i = this->m_pdata->m_data.size() - jump_offset; + } + return true; +-- +2.27.0 + diff --git a/backport-increase_used_block_count_when_use_-put_mem_block.patch b/backport-increase_used_block_count_when_use_-put_mem_block.patch new file mode 100644 index 0000000000000000000000000000000000000000..d13f744d3c4221815b598ee8857e960d04dc8eac --- /dev/null +++ b/backport-increase_used_block_count_when_use_-put_mem_block.patch @@ -0,0 +1,27 @@ +From db3c106f1e80e67f9ed80ee276c5e080519290ad Mon Sep 17 00:00:00 2001 +From: zhangyiru +Date: Thu, 14 Oct 2021 15:39:19 -0400 +Subject: [PATCH] increase used_block_count when use_ put_mem_block + +fix memleak problem: https://github.com/boostorg/regex/issues/153 + +Signed-off-by: zhangyiru +--- + boost/regex/v4/perl_matcher_non_recursive.hpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/boost/regex/v4/perl_matcher_non_recursive.hpp b/boost/regex/v4/perl_matcher_non_recursive.hpp +index eb470a78d..54ce751da 100644 +--- a/boost/regex/v4/perl_matcher_non_recursive.hpp ++++ b/boost/regex/v4/perl_matcher_non_recursive.hpp +@@ -1363,6 +1363,7 @@ bool perl_matcher::unwind_repeater_counter(bool + template + bool perl_matcher::unwind_extra_block(bool) + { ++ ++used_block_count; + saved_extra_block* pmp = static_cast(m_backup_state); + void* condemmed = m_stack_base; + m_stack_base = pmp->base; +-- +2.27.0 + diff --git a/boost.spec b/boost.spec index 04406ba5240322d84ba21cea7374ce6ba00aa728..4a2c2443aaec43f5acab1f3c6a6ab2bffc25f8cc 100644 --- a/boost.spec +++ b/boost.spec @@ -22,7 +22,7 @@ Name: boost Version: 1.73.0 -Release: 4 +Release: 5 Summary: The free peer-reviewed portable C++ source libraries License: Boost Software License V1.0 URL: http://www.boost.org @@ -45,6 +45,8 @@ Patch3: boost-1.58.0-pool-test_linking.patch Patch4: boost-1.66.0-no-rpath.patch Patch9000: regex-fix-dead-loop-in-parse_repeat.patch +Patch9001: backport-Disallow-repeating-a-case-change-group.patch +Patch9002: backport-increase_used_block_count_when_use_-put_mem_block.patch Requires: %{name}-atomic%{?_isa} = %{version}-%{release} Requires: %{name}-chrono%{?_isa} = %{version}-%{release} @@ -593,6 +595,8 @@ find ./boost -name '*.hpp' -perm /111 | xargs chmod a-x %patch3 -p1 %patch4 -p1 %patch9000 -p1 +%patch9001 -p1 +%patch9002 -p1 %build %if %{with python3} @@ -1139,6 +1143,13 @@ fi %{_mandir}/man1/bjam.1* %changelog +* Thu Oct 14 2021 zhangyiru - 1.73.0-5 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:increase used_block_count when use put_mem_block + Disallow repeating a case-change group + * Tue Jun 22 2021 Xu Huijie - 1.73.0-4 - Type:bugfix - ID:NA