DRACI: Fix potential negative array index read. CID 1003548

This commit is contained in:
Eugene Sandulenko 2013-10-17 14:03:37 +03:00
parent 54ebfe7dde
commit 74172a7449

View File

@ -953,7 +953,7 @@ void Game::dialogueMenu(int dialogueID) {
"hit: %d, _lines[hit]: %d, lastblock: %d, dialogueLines: %d, dialogueExit: %d",
hit, _lines[hit], _lastBlock, _dialogueLinesNum, _dialogueExit);
if ((!_dialogueExit) && (hit != -1) && (_lines[hit] != -1)) {
if ((!_dialogueExit) && (hit >= 0) && (_lines[hit] != -1)) {
if ((oldLines == 1) && (_dialogueLinesNum == 1) && (_lines[hit] == _lastBlock)) {
break;
}