Re: [PATCH] Segfault fix in pango



This looks fine as far as it goes but glancing at the code there seems
to be various places where md->text is appended to without checking to
see if it is NULL.

It wouldn't be hard to fix these up, but talking it over
with Havoc, we don't think that people will really use
it with text == NULL. So, the better course (reduce complexity)
is to simply always compute md->text, remove the existing
if (md->text) checks and discard the result if text == NULL.

Feel free to commit a patch to that effect.

Regards,
                                        Owen

Anders Carlsson <andersca gnu org> writes:

> A good idea is to actually attach the patch too :)
> 
> //andersca
> andersca gnu org
> 
> Index: ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/pango/ChangeLog,v
> retrieving revision 1.240
> diff -u -r1.240 ChangeLog
> --- ChangeLog	2001/04/13 23:47:49	1.240
> +++ ChangeLog	2001/04/16 09:01:48
> @@ -1,3 +1,8 @@
> +2001-04-16  Anders Carlsson  <andersca codefactory se>
> +
> +	* pango/pango-markup.c (pango_parse_markup): Set md->text to NULL if 
> +	text is NULL. This fixes a segfault.
> +
>  2001-04-14  Hans Breuer  <hans breuer org>
>  
>  	* pango/pangowin32-fontmap.c : instead of simply adding one
> Index: pango/pango-markup.c
> ===================================================================
> RCS file: /cvs/gnome/pango/pango/pango-markup.c,v
> retrieving revision 1.4
> diff -u -r1.4 pango-markup.c
> --- pango/pango-markup.c	2000/11/30 21:04:52	1.4
> +++ pango/pango-markup.c	2001/04/16 09:02:05
> @@ -603,6 +603,8 @@
>  
>    if (text)
>      md->text = g_string_new ("");
> +  else
> +    md->text = NULL;
>    
>    if (accel_char)
>      *accel_char = 0;




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