Re: SEGV when replying to mail.



Hi,

this is where I think a fix should be made:

Apparently some legacy code, possibly written before character set support
was added, assumes that a NULL charset means us-ascii.
It may break things if that were changed to always initialize the charset,
so I would suggest to make a NULL charset pointer a legal value here.


add_mutt_body_plain(const gchar * charset, gint encoding_style)
{
    BODY *body;
    gchar buffer[PATH_MAX];

    g_return_val_if_fail(charset, NULL);  <---------
    libbalsa_lock_mutt();
    body = mutt_new_body();


Sp, this would be the patch:

--- ../../balsa/libbalsa/send.c	Sun Aug 26 19:09:42 2001
+++ send.c	Sun Aug 26 19:27:42 2001
@@ -237,7 +237,6 @@
     BODY *body;
     gchar buffer[PATH_MAX];
 
-    g_return_val_if_fail(charset, NULL);
     libbalsa_lock_mutt();
     body = mutt_new_body();
 
@@ -249,7 +248,10 @@
     body->encoding = encoding_style;
     body->parameter = mutt_new_parameter();
     body->parameter->attribute = g_strdup("charset");
+	if (charset)
     body->parameter->value = g_strdup(charset);
+	else
+		body->parameter->value = g_strdup("us-ascii");
     body->parameter->next = NULL;
 
     mutt_mktemp(buffer);

It ensures that the return is always a new message body with a legal
charset.

Melanie




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