Summary: | Null pointer dereference at KateViewInternal::home | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Martin Pärtel <martin.partel> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Martin Pärtel
2006-04-10 23:21:04 UTC
I was not able to reproduce, but the bt shows exactly where it crashes: Missing check, whether the text line pointer is NULL in KateViewInternal::home. On Monday 10 April 2006 23:21, Martin Pأ¤rtel wrote:
> #18 0xb7870529 in KAccelPrivate::menuItemActivated (this=0x0)
> at kaccelprivate.moc:110
> #19 0xb78abf37 in KAccelPrivate::emitActivatedSignal (this=0x8c8c800,
> pAction=0x8c906d8) at kaccel.cpp:403
In step #18 this=0x0 is already wrong. I cannot see how that happens. Maybe
it is a kdecore issue, or even Qt bug? We cannot do anything about it right
now.
SVN commit 557058 by kling: Check textLine() return values in KateViewInternal's home() and end() functions. BUG: 125321 M +12 -2 kateviewinternal.cpp --- branches/KDE/3.5/kdelibs/kate/part/kateviewinternal.cpp #557057:557058 @@ -1233,8 +1233,13 @@ return; } + KateTextLine::Ptr l = textLine( cursor.line() ); + + if (!l) + return; + KateTextCursor c = cursor; - int lc = textLine( c.line() )->firstChar(); + int lc = l->firstChar(); if( lc < 0 || c.col() == lc ) { c.setCol(0); @@ -1270,9 +1275,14 @@ return; } + KateTextLine::Ptr l = textLine( cursor.line() ); + + if (!l) + return; + // "Smart End", as requested in bugs #78258 and #106970 KateTextCursor c = cursor; - int lc = textLine( c.line() )->lastChar(); + int lc = l->lastChar(); if (lc < 0 || c.col() == (lc + 1)) { c.setCol(currentRange().endCol - 1); SVN commit 557066 by kling: Forward-port of SVN commit 557058 by kling: Check textLine() return values in KateViewInternal's home() and end() functions. CCBUG: 125321 M +11 -2 kateviewinternal.cpp --- trunk/KDE/kdelibs/kate/part/kateviewinternal.cpp #557065:557066 @@ -1126,8 +1126,13 @@ return; } + KateTextLine::Ptr l = textLine( cursor.line() ); + + if (!l) + return; + KTextEditor::Cursor c = m_cursor; - int lc = textLine( c.line() )->firstChar(); + int lc = l->firstChar(); if( lc < 0 || c.column() == lc ) { c.setColumn(0); @@ -1167,9 +1172,13 @@ return; } + KateTextLine::Ptr l = textLine( cursor.line() ); + if (!l) + return; + // "Smart End", as requested in bugs #78258 and #106970 KTextEditor::Cursor c = m_cursor; - int lc = textLine( c.line() )->lastChar(); + int lc = l->lastChar(); if (lc < 0 || c.column() == (lc + 1)) { c.setColumn(currentLayout().endCol() - 1); |