Bug 54613 - Expanding a sidebar URL causes a crash if the URL doesn't end in a slash
Summary: Expanding a sidebar URL causes a crash if the URL doesn't end in a slash
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 44939 53450 53548 56880 58086 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-02-13 23:49 UTC by Lenon Kitchens
Modified: 2003-05-06 09:39 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lenon Kitchens 2003-02-13 23:49:09 UTC
Version:            (using KDE KDE 3.1)
Installed from:    Compiled From Sources
Compiler:          gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk) 
OS:          Linux

On the "Network" tab of the sidebar I created a new item under ftp archives.  I did this by copying the "KDE Official FTP" item, pasting and modifying it, and then copying the new version back to the sidebar under FTP Archives.  The only 2 things I modified were Name and URL.  The "Name" I set to NMS Server (Production).  The URL I set to "ftp://wmerpt01.arch.com".  At this point I could click on the item and get a login prompt and then konqueror would list the files correctly.  However, if I clicked on the plus beside the item konqueror would crash.  I finally got it to quit crashing by setting the URL to "ftp://wmerpt01.arch.com/export/home/user".
Comment 1 John Firebaugh 2003-04-07 05:50:43 UTC
*** Bug 56880 has been marked as a duplicate of this bug. ***
Comment 2 John Firebaugh 2003-04-07 05:52:28 UTC
*** Bug 53450 has been marked as a duplicate of this bug. ***
Comment 3 John Firebaugh 2003-04-07 05:52:32 UTC
*** Bug 53548 has been marked as a duplicate of this bug. ***
Comment 4 Thiago Macieira 2003-05-04 00:43:00 UTC
*** Bug 58086 has been marked as a duplicate of this bug. ***
Comment 5 Stephan Kulow 2003-05-05 15:27:27 UTC
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;


Comment 6 Stephan Kulow 2003-05-06 09:39:41 UTC
*** Bug 44939 has been marked as a duplicate of this bug. ***