Fixed potential overflow in OBJ Loader
Former-commit-id: 8356daec0fc094c8316d9f0cfabfb6f4ccb8a1e7
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user