Fix out of bounds memory access. (#1697)

This commit is contained in:
karliss 2019-08-03 13:18:05 +03:00 committed by Itay Cohen
parent 148c7aa9e9
commit 1fd06a26c5

View File

@ -681,13 +681,13 @@ QRectF DisassemblerGraphView::getInstrRect(GraphView::GraphBlock &block, RVA add
firstLineWithAddr = currentLine;
}
if (instr.contains(addr)) {
while (i < db.instrs.size() && db.instrs[i + 1].addr == sequenceAddr) {
while (i < db.instrs.size() && db.instrs[i].addr == sequenceAddr) {
currentLine += db.instrs[i].text.lines.size();
i++;
}
QPointF topLeft = getInstructionOffset(db, static_cast<int>(firstLineWithAddr));
return QRectF(topLeft, QSizeF(block.width - 4 * charWidth,
charHeight * int(currentLine - firstLineWithAddr + db.instrs[i].text.lines.size())));
charHeight * int(currentLine - firstLineWithAddr)));
}
currentLine += instr.text.lines.size();
}