Re: BUG report



On 03/05/2010 09:38:03 AM Fri, Mario Mikocevic wrote:
On 03/05/2010 03:08:42 PM, Peter Bloomfield wrote:
[ snip ]
I can't even send myself a test mail with such a cc-holder to *try* to reproduce it!

Just try 'telnet host 25' and do the oldfashionhacker way SMTP handshake sequence :)
Then after that mail sits in your mailbox fireup balse and reply to it.

Even editing plain text file and catting it at the end of /var/spool/mail/username should do the trick.

OK--managed to create a test message the easier way, with 64-bit Balsa!

I paste the address into the address-view, and it all looks fine--properly quoted.  But if I save the message in the draftbox or hit "send", that address gets mangled as described.  Looks like it might be related to <URL:https://bugzilla.gnome.org/show_bug.cgi?id=588521>.  It may be reproducible only on a 32-bit box...

Yep--no problem on a 64-bit box, only on 32-bit.  The problem seems to originate in GMime, specifically in rfc2047_encode_get_rfc822_words.  Apparently, a compiler error leads to 32-bit machine code that returns an incorrect NULL value, and...bad stuff ensues.  If you're interested, the attached patch, applied to GMime from git, fixes the problem.  Look closely and you'll see that the patch makes no substantive change--it replaces valid source code with equally valid source, but just seems to lead to valid machine code.

Peter
diff --git a/gmime/gmime-utils.c b/gmime/gmime-utils.c
index 90c5cda..0eb697a 100644
--- a/gmime/gmime-utils.c
+++ b/gmime/gmime-utils.c
@@ -2175,13 +2175,13 @@ typedef struct _rfc822_word {
 static rfc822_word *
 rfc2047_encode_get_rfc822_words (const char *in, gboolean phrase)
 {
-	rfc822_word *words, *tail, *word;
+	rfc822_word *words, **tail, *word;
 	rfc822_word_t type = WORD_ATOM;
 	const char *inptr, *start, *last;
 	int count = 0, encoding = 0;
 	
 	words = NULL;
-	tail = (rfc822_word *) &words;
+	tail = &words;
 	
 	last = start = inptr = in;
 	while (inptr && *inptr) {
@@ -2207,8 +2207,8 @@ rfc2047_encode_get_rfc822_words (const char *in, gboolean phrase)
 				word->type = type;
 				word->encoding = encoding;
 				
-				tail->next = word;
-				tail = word;
+				*tail = word;
+				tail = &word->next;
 				count = 0;
 			}
 			
@@ -2237,8 +2237,8 @@ rfc2047_encode_get_rfc822_words (const char *in, gboolean phrase)
 				word->type = type;
 				word->encoding = encoding;
 				
-				tail->next = word;
-				tail = word;
+				*tail = word;
+				tail = &word->next;
 				count = 0;
 				
 				/* Note: don't reset 'type' as it
@@ -2260,8 +2260,8 @@ rfc2047_encode_get_rfc822_words (const char *in, gboolean phrase)
 		word->type = type;
 		word->encoding = encoding;
 		
-		tail->next = word;
-		tail = word;
+		*tail = word;
+		tail = &word->next;
 	}
 	
 #if d(!)0

Attachment: pgpnLUtNwyGZ5.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]