Fixed potential overflow in OBJ Loader

Former-commit-id: 8356daec0fc094c8316d9f0cfabfb6f4ccb8a1e7
This commit is contained in:
Lynix 2014-03-18 19:53:24 +01:00
parent 37197a3840
commit 90ebf4940c
1 changed files with 2 additions and 2 deletions

View File

@ -243,7 +243,7 @@ bool NzOBJParser::Parse()
case 'g':
case 'o':
{
if (m_currentLine[1] != ' ')
if (m_currentLine.GetSize() <= 2 || m_currentLine[1] != ' ')
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
UnrecognizedLine();
@ -267,7 +267,7 @@ bool NzOBJParser::Parse()
case 's':
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
if (m_currentLine[1] == ' ')
if (m_currentLine.GetSize() <= 2 || m_currentLine[1] == ' ')
{
NzString param = m_currentLine.SubString(2);
if (param != "all" && param != "on" && param != "off" && !param.IsNumber())