From 8d48db25cc9b24c63d08fb85c6e132828b99edc6 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 7 Jul 2012 12:14:09 +0000 Subject: [PATCH] Add check before copying data. Fixes #7032. [SVN r79333] --- src/regex_raw_buffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/regex_raw_buffer.cpp b/src/regex_raw_buffer.cpp index 84a2fd5d..f75f0a51 100644 --- a/src/regex_raw_buffer.cpp +++ b/src/regex_raw_buffer.cpp @@ -46,7 +46,8 @@ void BOOST_REGEX_CALL raw_storage::resize(size_type n) // allocate and copy data: register pointer ptr = static_cast(::operator new(newsize)); BOOST_REGEX_NOEH_ASSERT(ptr) - std::memcpy(ptr, start, datasize); + if(start) + std::memcpy(ptr, start, datasize); // get rid of old buffer: ::operator delete(start);