Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37401257
en ru br
ALT Linux repos
S:1.83.0-alt2
D:1.37.0-alt2
5.0: 1.36.0-alt4
4.1: 1.34.1-alt1
4.0: 1.33.1-alt4
3.0: 1.32.0-alt2

Group :: Development/C++
RPM: boost

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: boost-regex-fix-r42674.patch
Download


Index: /trunk/boost/regex/v4/basic_regex_parser.hpp
===================================================================
--- /trunk/boost/regex/v4/basic_regex_parser.hpp (revision 38864)
+++ /trunk/boost/regex/v4/basic_regex_parser.hpp (revision 42674)
@@ -785,4 +785,5 @@
       case syntax_element_jump:
       case syntax_element_startmark:
+      case syntax_element_backstep:
          // can't legally repeat any of the above:
          fail(regex_constants::error_badrepeat, m_position - m_base);
@@ -1870,4 +1871,5 @@
    {
       re_syntax_base* b = this->getaddress(expected_alt_point);
+      // Make sure we have exactly one alternative following this state:
       if(b->type != syntax_element_alt)
       {
@@ -1878,4 +1880,13 @@
       {
          fail(regex_constants::error_bad_pattern, m_position - m_base);
+         return false;
+      }
+      // check for invalid repetition of next state:
+      b = this->getaddress(expected_alt_point);
+      b = this->getaddress(static_cast<re_alt*>(b)->next.i, b);
+      if((b->type != syntax_element_assert_backref)
+         && (b->type != syntax_element_startmark))
+      {
+         fail(regex_constants::error_badrepeat, m_position - m_base);
          return false;
       }
Index: /trunk/libs/regex/test/regress/test_perl_ex.cpp
===================================================================
--- /trunk/libs/regex/test/regress/test_perl_ex.cpp (revision 30980)
+++ /trunk/libs/regex/test/regress/test_perl_ex.cpp (revision 42674)
@@ -122,4 +122,15 @@
    TEST_INVALID_REGEX("(?:(a)|b)(?(?<", perl);
    TEST_INVALID_REGEX("(?:(a)|b)(?(?<a", perl);
+
+   TEST_INVALID_REGEX("(?(?!#?)+)", perl);
+   TEST_INVALID_REGEX("(?(?=:-){0})", perl);
+   TEST_INVALID_REGEX("(?(123){1})", perl);
+   TEST_INVALID_REGEX("(?(?<=A)*)", perl);
+   TEST_INVALID_REGEX("(?(?<=A)+)", perl);
+
+   TEST_INVALID_REGEX("(?<!*|^)", perl);
+   TEST_INVALID_REGEX("(?<!*|A)", perl);
+   TEST_INVALID_REGEX("(?<=?|A)", perl);
+   TEST_INVALID_REGEX("(?<=*|\\B)", perl);
 }
 
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin