mirror of
https://github.com/boostorg/serialization.git
synced 2026-02-26 04:52:27 +00:00
correct dereference of iterator incremented past end()
This commit is contained in:
@@ -9,7 +9,8 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifdef BOOST_NO_CXX11_HDR_CODECVT
|
||||
//#ifdef BOOST_NO_CXX11_HDR_CODECVT
|
||||
#if 1
|
||||
#include <boost/archive/detail/decl.hpp>
|
||||
#define BOOST_UTF8_BEGIN_NAMESPACE \
|
||||
namespace boost { namespace archive { namespace detail {
|
||||
|
||||
@@ -143,15 +143,16 @@ template<class Base>
|
||||
void wchar_from_mb<Base>::drain(){
|
||||
BOOST_ASSERT(! m_input.m_done);
|
||||
for(;;){
|
||||
typename boost::iterators::iterator_reference<Base>::type c = *(this->base_reference()++);
|
||||
* const_cast<typename iterator_value<Base>::type *>(
|
||||
(m_input.m_next_available++)
|
||||
) = c;
|
||||
typename boost::iterators::iterator_reference<Base>::type c = *(this->base_reference());
|
||||
// a null character in a multibyte stream is takes as end of string
|
||||
if(0 == c){
|
||||
m_input.m_done = true;
|
||||
break;
|
||||
}
|
||||
++(this->base_reference());
|
||||
* const_cast<typename iterator_value<Base>::type *>(
|
||||
(m_input.m_next_available++)
|
||||
) = c;
|
||||
// if input buffer is full - we're done for now
|
||||
if(m_input.m_buffer.end() == m_input.m_next_available)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user