diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 77d06abfe0fd..01c33a3ab534 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -1646,7 +1646,7 @@ std::size_t SvMemoryStream::PutData( const void* pData, std::size_t nCount ) } else { - const bool bSourceDataIsInsideBuffer = pData >= pBuf && pData <= (pBuf + nSize); + const bool bSourceDataIsInsideBuffer = pData >= pBuf && pData < (pBuf + nSize); std::ptrdiff_t const offset = bSourceDataIsInsideBuffer ? static_cast(pData) - reinterpret_cast(pBuf) : 0; tools::Long nNewResize; if( nSize && nSize > nResize )