File r927289.diff of Package kdepim4

Subject: kmail: do not execute executables when clicking a link, and solve dangling kmmsgbase pointer crash
From: wstephenson@suse.de
Bug: kde#179765,bnc#490696
Patch-upstream: 927289
--- kmail/kmcommands.cpp	(revision 927288)
+++ kmail/kmcommands.cpp	(revision 927289)
@@ -2333,7 +2333,8 @@ KMCommand::Result KMUrlClickedCommand::e
           mUrl.pathOrUrl() ), QString(), KGuiItem(i18n("Execute")), KStandardGuiItem::cancel() ) != KMessageBox::Yes)
         return Canceled;
     }
-    (void) new KRun( mUrl, mMainWidget );
+    KRun *runner = new KRun( mUrl, mMainWidget ); // will delete itself
+    runner->setRunExecutables( false );
   }
   else
     return Failed;
--- kmail/kmfolderimap.cpp	(revision 927288)
+++ kmail/kmfolderimap.cpp	(revision 927289)
@@ -1490,11 +1490,18 @@ void KMFolderImap::flagsToStatus(KMMsgBa
       // toggleStatus(), and get a valid msg pointer afterwards.
       KMFolderIndex *storage = msg->storage();
       int oldIndex = -1;
+      const bool msgIsKMMessage = msg->isMessage();
       if ( storage )
         oldIndex = storage->find( msg );
       msg->toggleStatus( imapFlagMap[i].kmFlag );
-      if ( storage )
-        msg = storage->getMsg( oldIndex );
+      if ( storage ) {
+        if ( msgIsKMMessage ) {
+          msg = storage->getMsg( oldIndex );
+        }
+        else {
+          msg = storage->getMsgBase( oldIndex );
+        }
+      }
     }
   }
 
Index: kmail/kmcommands.cpp
===================================================================
Index: kmail/kmfolderimap.cpp
===================================================================
openSUSE Build Service is sponsored by