ensure OUString::copy is within bounds

Change-Id: I7b8c2e764da01e38fb9f7048bcaeca93a72fafa3
This commit is contained in:
Caolán McNamara
2013-09-22 12:28:31 +01:00
parent 28c9207da4
commit c86a23b9c7

View File

@@ -441,7 +441,7 @@ void SmParser::NextToken()
}
else if (aRes.TokenType & KParseType::ONE_SINGLE_CHAR)
{
if (m_aBufferString.copy(nRealStart, 2) == "%%")
if (nRealStart + 2 <= nBufLen && m_aBufferString.copy(nRealStart, 2) == "%%")
{
//SkipComment
m_nBufferIndex = nRealStart + 2;