Don't read beyond buffer end.

This commit is contained in:
Bartosz Taudul 2020-06-04 02:46:46 +02:00
parent 917da8cff3
commit c52936855e

View File

@ -475,12 +475,12 @@ void SourceView::ParseSource( const char* fileName, const Worker& worker, const
if( *end == '\n' )
{
end++;
if( *end == '\r' ) end++;
if( end - m_data < sz && *end == '\r' ) end++;
}
else if( *end == '\r' )
{
end++;
if( *end == '\n' ) end++;
if( end - m_data < sz && *end == '\n' ) end++;
}
if( end - m_data == sz ) break;
txt = end;