From 330a033177bbb14396794fa829f5ca98fe912b46 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 22 Jan 2014 13:46:38 +0000 Subject: [PATCH] Tentative fix for case where a transformation of a NULL string is requested. --- include/boost/regex/v4/cpp_regex_traits.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/boost/regex/v4/cpp_regex_traits.hpp b/include/boost/regex/v4/cpp_regex_traits.hpp index b81d8c84..72ea2b21 100644 --- a/include/boost/regex/v4/cpp_regex_traits.hpp +++ b/include/boost/regex/v4/cpp_regex_traits.hpp @@ -508,6 +508,10 @@ typename cpp_regex_traits_implementation::string_type // we adhere to gcc's (buggy) preconditions... // BOOST_ASSERT(*p2 == 0); + if(p1 == p2) + { + return string_type(p1, p2); + } string_type result; // @@ -584,6 +588,11 @@ typename cpp_regex_traits_implementation::string_type // std::bad_alloc for certain arguments... // string_type result, result2; + if(p1 == p2) + { + result.assign(p1, p2); + return result; + } #ifndef BOOST_NO_EXCEPTIONS try{ #endif