Fix off-by-one error when adding raw data to buffer

One byte too few could be added to packers as raw data. Detected by the new test cases.
This commit is contained in:
Robert Müller 2023-05-03 18:19:04 +02:00
parent 8794cc9f9c
commit c5e336f5e2

View file

@ -66,7 +66,7 @@ void CPacker::AddRaw(const void *pData, int Size)
if(m_Error)
return;
if(m_pCurrent + Size >= m_pEnd)
if(m_pCurrent + Size > m_pEnd)
{
m_Error = true;
return;