Re: [evolution-patches] fix for bug #61199 (mailer)



this was committed friday

On Thu, 2004-07-08 at 12:57 -0400, Jeffrey Stedfast wrote:
> crash when opening a message due to NULL being passed to g_strdup_printf
> on a Solaris box.
> 
> To: " " <foo bar com>
> 
> the problem was that the encoded name becomes NULL since there's nothing
> to actually encode.
> 
> Jeff
> 
> Plain text document attachment (61199.patch)
> ? 55303-2.patch
> ? 55303.patch
> ? 61199.patch
> ? foo
> Index: ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
> retrieving revision 1.3411
> diff -u -r1.3411 ChangeLog
> --- ChangeLog	5 Jul 2004 15:08:21 -0000	1.3411
> +++ ChangeLog	7 Jul 2004 16:05:00 -0000
> @@ -1,3 +1,12 @@
> +2004-07-07  Jeffrey Stedfast  <fejj novell com>
> +
> +	Fix for bug #61199.
> +
> +	* em-format-html.c (efh_format_address): Same.
> +
> +	* em-format-quote.c (emfq_format_address): Make sure 'real' isn't
> +	NULL before using.
> +
>  2004-07-02  JP Rosevaer  <jpr novell com>
>  
>  	* Makefile.am (SUBDIRS): Revert previous error change
> Index: em-format-html.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/em-format-html.c,v
> retrieving revision 1.60
> diff -u -r1.60 em-format-html.c
> --- em-format-html.c	24 May 2004 08:02:25 -0000	1.60
> +++ em-format-html.c	7 Jul 2004 16:05:00 -0000
> @@ -1433,11 +1433,14 @@
>  				
>  				g_string_append_printf (out, "%s &lt;", name);
>  				/* rfc2368 for mailto syntax and url encoding extras */
> -				real = camel_header_encode_phrase(a->name);
> -				mailaddr = g_strdup_printf("%s <%s>", real, a->v.addr);
> -				g_free(real);
> -				mailto = camel_url_encode(mailaddr, "?=&()");
> -				g_free(mailaddr);
> +				if ((real = camel_header_encode_phrase (a->name))) {
> +					mailaddr = g_strdup_printf("%s <%s>", real, a->v.addr);
> +					g_free (real);
> +					mailto = camel_url_encode (mailaddr, "?=&()");
> +					g_free (mailaddr);
> +				} else {
> +					mailto = camel_url_encode (a->v.addr, "?=&()");
> +				}
>  			} else {
>  				mailto = camel_url_encode (a->v.addr, "?=&()");
>  			}
> Index: em-format-quote.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/em-format-quote.c,v
> retrieving revision 1.10
> diff -u -r1.10 em-format-quote.c
> --- em-format-quote.c	25 May 2004 16:16:25 -0000	1.10
> +++ em-format-quote.c	7 Jul 2004 16:05:00 -0000
> @@ -209,14 +209,17 @@
>  		case CAMEL_HEADER_ADDRESS_NAME:
>  			if (name && *name) {
>  				char *real, *mailaddr;
> -
> +				
>  				g_string_append_printf (out, "%s &lt;", name);
>  				/* rfc2368 for mailto syntax and url encoding extras */
> -				real = camel_header_encode_phrase (a->name);
> -				mailaddr = g_strdup_printf ("%s <%s>", real, a->v.addr);
> -				g_free (real);
> -				mailto = camel_url_encode (mailaddr, "?=&()");
> -				g_free (mailaddr);
> +				if ((real = camel_header_encode_phrase (a->name))) {
> +					mailaddr = g_strdup_printf ("%s <%s>", real, a->v.addr);
> +					g_free (real);
> +					mailto = camel_url_encode (mailaddr, "?=&()");
> +					g_free (mailaddr);
> +				} else {
> +					mailto = camel_url_encode (a->v.addr, "?=&()");
> +				}
>  			} else {
>  				mailto = camel_url_encode (a->v.addr, "?=&()");
>  			}




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