Closed vadi2 closed 11 years ago
Fixed in mudletDev branch.
Does the buffer count from 0? If it does, the patch would be susceptible to an off-by-one error:
if ( yind > mpBuffer->lineBuffer.size() )
return;
yind = 2
lineBuffer.size() = 2 (so 0
and 1
are the valid indexes)
if ( 2 > 2 ) (false!)
return; (won't return!)
Maybe. Repushed a version that accounts for that.
When you double-click on the space in a line that has no text, a crash happens. See this video for a demo: http://ge.tt/5Irsvuj/v/0
I've did some work to dig about and narrowed it down to this commit: https://github.com/Chris7/Mudlet2/commit/60f248b920a84911babaaa13e01aef154c9a12d1
The issue in question is the line
QString c = mpBuffer->lineBuffer[yind].at(xind);
, in which the at() function will cause a crash: xind tries to access a part of the line that doesn't have any text on it. See two screenshots that demonstrating this - notice how line 44 is just "" and it tries to do .at(26), which is invalid.