Bug 120448 - Crash when creating a mail folder with a / in its name
Summary: Crash when creating a mail folder with a / in its name
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: 1.9
Platform: Gentoo Packages Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 125044 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-01-19 13:08 UTC by Ian Ventura-Whiting
Modified: 2007-09-14 12:17 UTC (History)
2 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 Ian Ventura-Whiting 2006-01-19 13:08:41 UTC
Version:           1.9 (using KDE KDE 3.5.0)
Installed from:    Gentoo Packages
Compiler:          gcc version 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6) CFLAGS="-O2 -march=pentium4 -pipe"
OS:                Linux

This crash happens when creating a mail folder with a / in the name. KMail attempts to create the folder then fails. Eventually the program crashes. This crash happens because KMail does not: 

1) Check that a valid folder name is supplied (with valid characters)
2) Correctly handle the situation where the folder could not be created.
Comment 1 Tommi Tervo 2006-01-19 16:50:25 UTC
Cannot reproduce, I'll get message box which says that / is illegal in folder name.
Comment 2 Ian Ventura-Whiting 2006-01-19 20:24:37 UTC
I have reproduced it on 2 machines and a collegue has reproduced it on their machine. The two machines I have tried it on are a 64bit Linux machine and a DELL workstation. My collegue has reproduced it on a DELL laptop.

The / has to be part of the mail subfolder name, e.g. "dsfsdf/dsgfdsgs" will cause KMail (incl. Kontact) to produce several error windows followed by a crash.
Comment 3 Ian Ventura-Whiting 2006-05-16 18:43:22 UTC
This is still a problem with KMail 1.9.1 on KDE 3.5.2.

If you use the "maildir" format mail folders, go to create a new subfolder. Enter the folder name as "crash/me" (without the quotes) then go through the error windows and watch KMail crash and burn.

The problem is that KMail is not escaping the "/" character from the text that the user entered.
Comment 4 Ismail Onur Filiz 2006-05-16 19:01:55 UTC
*** Bug 125044 has been marked as a duplicate of this bug. ***
Comment 5 Carsten Lohrke 2006-05-19 14:35:39 UTC
Trying to reproduce this I found that while creating a folder '/' as a subfolder of a toplevel folder results in an error message that this is not possible, creating a such folder in other subfolders is possible and lead to the following error message

>Fehler beim Öffnen von /home/carsten/Mail/.OS >Development.directory/.Bugzilla.directory///new. Dieser Ordner ist nicht >vorhanden.

or in english

Error when opening /...  
Dev... This folder does not exist.


After clicking the message away multiple times, the folder shows up in the tree and the io slave crashes with 

kio (KIOJob): error 11 /usr/kde/3.5/share/apps/kmail/about/box-center-kmail.png
kmail: updateSearch( -- )
kmail: updateSearch( -- )
*** KMail got signal 11 (Crashing)
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kmail path = <unknown> pid = 12546
Comment 6 Nicolas Girard 2006-05-24 16:12:37 UTC
I confirm this defect still exists, here on Mandriva Cooker & KMail 1.9.1.
Please change the status of this report from UNCONFIRMED to NEW.
Comment 7 Ian Ventura-Whiting 2006-06-12 12:02:59 UTC
This issue also exists in SuSE 10.1 with the KDE 3.5.3 packages. Please ,ark this as NEW rather than unconfirmed.
Comment 8 Ingo Klöcker 2006-06-13 01:00:39 UTC
SVN commit 550851 by kloecker:

Fix bug 120448 (Crash when creating a mail folder with a / in its name)
BUG:120448

 M  +13 -7     newfolderdialog.cpp  


--- branches/KDE/3.5/kdepim/kmail/newfolderdialog.cpp #550850:550851
@@ -61,8 +61,8 @@
       mFolder( folder )
 {
   setWFlags( getWFlags() | WDestructiveClose );
-  if ( folder ) {
-    setCaption( i18n("New Subfolder of %1").arg( folder->prettyURL() ) );
+  if ( mFolder ) {
+    setCaption( i18n("New Subfolder of %1").arg( mFolder->prettyURL() ) );
   }
   QWidget* privateLayoutWidget = new QWidget( this, "mTopLevelLayout" );
   privateLayoutWidget->setGeometry( QRect( 10, 10, 260, 80 ) );
@@ -183,24 +183,30 @@
 
 void NewFolderDialog::slotOk()
 {
-  const QString &fldName = mNameLineEdit->text();
+  const QString fldName = mNameLineEdit->text();
   if ( fldName.isEmpty() ) {
      KMessageBox::error( this, i18n("Please specify a name for the new folder."),
         i18n( "No Name Specified" ) );
      return;
   }
+
+  // names of local folders must not contain a '/'
   if ( fldName.find( '/' ) != -1 &&
-    ( !mFolder
-      || mFolder->folderType() == KMFolderTypeImap
-      || mFolder->folderType() == KMFolderTypeCachedImap ) ) {
+       ( !mFolder ||
+         ( mFolder->folderType() != KMFolderTypeImap &&
+           mFolder->folderType() != KMFolderTypeCachedImap ) ) ) {
     KMessageBox::error( this, i18n( "Folder names cannot contain the / (slash) character; please choose another folder name." ) );
     return;
   }
 
+  // folder names must not start with a '.'
   if ( fldName.startsWith( "." ) ) {
     KMessageBox::error( this, i18n( "Folder names cannot start with a . (dot) character; please choose another folder name." ) );
     return;
-  } else if ( mFolder &&
+  }
+
+  // names of IMAP folders must not contain the folder delimiter
+  if ( mFolder &&
       ( mFolder->folderType() == KMFolderTypeImap ||
         mFolder->folderType() == KMFolderTypeCachedImap ) ) {
     QString delimiter;
Comment 9 Bram Schoenmakers 2007-03-14 22:36:51 UTC
*** Bug 142937 has been marked as a duplicate of this bug. ***