<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>92412</bug_id>
          
          <creation_ts>2004-10-30 22:06:23 +0000</creation_ts>
          <short_desc>If PGP/MIME encrypted messages are BCC&apos;ed then except for one message all messages are empty</short_desc>
          <delta_ts>2007-09-14 12:17:01 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kmail</product>
          <component>encryption</component>
          <version>1.7</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ingo Klöcker">kloecker</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          <cc>david.guembel</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>281351</commentid>
    <comment_count>0</comment_count>
    <who name="Ingo Klöcker">kloecker</who>
    <bug_when>2004-10-30 22:06:23 +0000</bug_when>
    <thetext>Version:           1.7.50 (using KDE 3.3.0, compiled sources)
Compiler:          gcc version 3.3.3 (SuSE Linux)
OS:                Linux (i686) release 2.6.5-7.108-default

Send an PGP/MIME encrypted message to someone and BCC yourself. Two messages will be created (which is intended behavior). One message contains the encrypted message text, but the second message only contains an encrypted empty message part.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>281353</commentid>
    <comment_count>1</comment_count>
    <who name="Ingo Klöcker">kloecker</who>
    <bug_when>2004-10-30 22:07:31 +0000</bug_when>
    <thetext>This problem is also present in KDE 3.3 and KDE 3.3.1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>281359</commentid>
    <comment_count>2</comment_count>
    <who name="Ingo Klöcker">kloecker</who>
    <bug_when>2004-10-30 22:21:43 +0000</bug_when>
    <thetext>CVS commit by kloecker: 

Fix PGP/MIME encrypting messages which are BCC&apos;ed. The problem was that KMMessagePart contains a QByteArray which is explicitely shared. Therefore simply copying a KMMessagePart with the copy c&apos;tor for getting a temporary copy isn&apos;t possible. Implementing and using a duplicate method fixes the problem.
BUG: 92412


  M +9 -0      kmmsgpart.cpp   1.113
  M +4 -0      kmmsgpart.h   1.42
  M +2 -1      messagecomposer.cpp   1.36


--- kdepim/kmail/kmmsgpart.h  #1.41:1.42
@@ -23,4 +23,8 @@ public:
   void clear();
 
+  /** Obtains an independant copy (i.e. without explicitely shared data) of the
+      data contained in msgPart. Returns a reference to this message part. */
+  KMMessagePart &amp; duplicate( const KMMessagePart &amp; msgPart );
+
   /** Get or set the message body */
   QCString body(void) const;

--- kdepim/kmail/kmmsgpart.cpp  #1.112:1.113
@@ -81,4 +81,13 @@ void KMMessagePart::clear()
 
 //-----------------------------------------------------------------------------
+KMMessagePart &amp; KMMessagePart::duplicate( const KMMessagePart &amp; msgPart )
+{
+  // copy the data of msgPart
+  *this = msgPart;
+  // detach the explicitely shared QByteArray
+  mBody.detach();
+}
+
+//-----------------------------------------------------------------------------
 int KMMessagePart::decodedSize(void) const
 {

--- kdepim/kmail/messagecomposer.cpp  #1.35:1.36
@@ -960,5 +960,6 @@ public:
 
   void execute() {
-    KMMessagePart tmpNewBodyPart = *mNewBodyPart;
+    KMMessagePart tmpNewBodyPart;
+    tmpNewBodyPart.duplicate( *mNewBodyPart );
 
     // TODO: Async call


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294161</commentid>
    <comment_count>3</comment_count>
    <who name="Till Adam">adam</who>
    <bug_when>2004-12-14 09:06:22 +0000</bug_when>
    <thetext>*** Bug 91697 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>