Do not crash if real files have less lines than what the patch claims

BUG: 420771
FIXED-IN: 20.04.1
parent e6f5cd9d
......@@ -1110,9 +1110,10 @@ bool KompareModelList::blendFile(DiffModel* model, const QString& fileContents)
// Now we add the linecount difference for the hunk that follows
int size = hunk->sourceLineCount();
for (int i = 0; i < size; ++i)
linesIt += size;
if (linesIt > lEnd)
{
++linesIt;
linesIt = lEnd;
}
srcLineNo += size;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment