| Summary: | Expanding a sidebar URL causes a crash if the URL doesn't end in a slash | ||
|---|---|---|---|
| Product: | [Applications] konqueror | Reporter: | Lenon Kitchens <lenon> |
| Component: | general | Assignee: | Konqueror Bugs <konqueror-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | 2rparlett, fred, lehman, r.amore, thubi |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Lenon Kitchens
2003-02-13 23:49:09 UTC
*** Bug 56880 has been marked as a duplicate of this bug. *** *** Bug 53450 has been marked as a duplicate of this bug. *** *** Bug 53548 has been marked as a duplicate of this bug. *** *** Bug 58086 has been marked as a duplicate of this bug. *** Subject: kdebase/konqueror/sidebar/trees/dirtree_module CVS commit by coolo: do not up cast to invalid classes (I bet this is also the cause of many lan:/ crashes we've seen) CCMAIL: 54613-done@bugs.kde.org M +9 -5 dirtree_module.cpp 1.25 --- kdebase/konqueror/sidebar/trees/dirtree_module/dirtree_module.cpp #1.24:1.25 @@ -135,9 +135,10 @@ void KonqSidebarDirTreeModule::removeSub { bool b = m_dictSubDirs.remove( item->externalURL().url(-1) ); - while (!(((KonqSidebarDirTreeItem*) item)->alias.isEmpty())) + KonqSidebarDirTreeItem *ditem = dynamic_cast<KonqSidebarDirTreeItem*>(item); + while (ditem && !(ditem->alias.isEmpty())) { - b = b|m_dictSubDirs.remove( ((KonqSidebarDirTreeItem*) item)->alias.front() ); + b = b|m_dictSubDirs.remove( ditem->alias.front() ); - ((KonqSidebarDirTreeItem*) item)->alias.pop_front(); + ditem->alias.pop_front(); } if (!b) @@ -315,6 +316,9 @@ void KonqSidebarDirTreeModule::slotRedir if (item->parent()) { - ((KonqSidebarDirTreeItem*) item)->alias<<oldUrl.url(-1); - ((KonqSidebarDirTreeItem*) item)->alias<<newUrl.url(-1); + KonqSidebarDirTreeItem* ditem = dynamic_cast<KonqSidebarDirTreeItem*>(item); + if (ditem) { + ditem->alias<<oldUrl.url(-1); + ditem->alias<<newUrl.url(-1); + } } kdDebug(1201) << "Updating url to " << newUrl.prettyURL() << endl; |