Revision: 7263
          http://svn.sourceforge.net/mahogany/?rev=7263&view=rev
Author:   vadz
Date:     2007-05-01 17:57:43 -0700 (Tue, 01 May 2007)

Log Message:
-----------
fix recently introduced crash in AppendMessage() (keep ASCII buffer alive long 
enough to use it)

Modified Paths:
--------------
    trunk/M/src/mail/MailFolderCC.cpp

Modified: trunk/M/src/mail/MailFolderCC.cpp
===================================================================
--- trunk/M/src/mail/MailFolderCC.cpp   2007-05-01 23:37:18 UTC (rev 7262)
+++ trunk/M/src/mail/MailFolderCC.cpp   2007-05-02 00:57:43 UTC (rev 7263)
@@ -3075,8 +3075,9 @@
 
    CHECK_DEAD_RC("Appending to closed folder '%s' failed.", false);
 
+   wxCharBuffer msgbuf(msg.mb_str(wxConvISO8859_1));
    STRING str;
-   INIT(&str, mail_string, msg.char_str(), msg.Length());
+   INIT(&str, mail_string, msgbuf.data(), msg.length());
 
    if ( !mail_append(m_MailStream, m_ImapSpec.char_str(), &str) )
    {
@@ -3120,9 +3121,10 @@
 
    String flags = GetImapFlags(msg.GetStatus());
 
-   char *tmpstr = tmp.char_str();
+   // keep the char buffer alive until after mail_append_full() returns
+   wxCharBuffer tmpbuf(tmp.mb_str(wxConvISO8859_1));
    STRING str;
-   INIT(&str, mail_string, tmpstr, strlen(tmpstr));
+   INIT(&str, mail_string, tmpbuf.data(), tmp.length());
 
    CHECK_DEAD_RC("Appending to closed folder '%s' failed.", false);
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to