Avoid SIGSEGV in case of incorrectly recorded command dump processing

This commit is contained in:
vsr 2019-03-26 14:38:44 +03:00
parent a41868ac87
commit 175b357b21

View File

@ -1415,6 +1415,8 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
aStartPos = aCommand.Location(i-1, COMMA, 1, aCommand.Length()) + 2; aStartPos = aCommand.Location(i-1, COMMA, 1, aCommand.Length()) + 2;
aEndPos = aCommand.Location(i, COMMA, 1, aCommand.Length()); aEndPos = aCommand.Location(i, COMMA, 1, aCommand.Length());
} }
if (aStartPos == 0 || aEndPos == 0)
continue;
if( aCommand.Value( aStartPos ) == O_SQR_BRACKET ) if( aCommand.Value( aStartPos ) == O_SQR_BRACKET )
aStartPos++; aStartPos++;