Re: [PATCH] gnome_vfs_uri_extract_short_name() should never return NULL



On Mon, 2005-01-24 at 12:13 +0100, Vincent Untz wrote:
> Hi,
> 
> (See bug http://bugzilla.gnome.org/show_bug.cgi?id=157723 for the bug)
> 
> For some URI, gnome_vfs_uri_extract_short_name() returns NULL while it
> should not. This is causing a crash in the panel because the egg recent
> code does not check the value returned by this function. But I don't
> think we should need to check that the value is not NULL: this should
> never happen.
> 
> An example of such an URI is:
> http://elmundodeporte.elmundo.es/elmundodeporte/album/index.html?k=2&dia1=27%22%3E%3Ciframe%20width=800%20height=900%20frameborder=0%20src=http%3A%2F%2Flatinsud.com%2F28.html%3E%20
> 
> When short_path_name is NULL (this can happen when slashes are encoded
> in the URI, as in the example above), host_name is not modified and is
> NULL too. So we return short_path_name.
> 
> A patch is available at
> http://bugzilla.gnome.org/attachment.cgi?id=35337&action=view
> With the patch, we return the hostname if short_path_name is NULL or if
> it's /. And we never return NULL.
> 
> I forgot to add a ChangeLog entry in the patch, but I'll do it if it's
> okay to commit.

You seem to leak in the final else clause. Otherwise it looks good to
me.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a scarfaced day-dreaming grifter on the run. She's an orphaned 
French-Canadian Valkyrie descended from a line of powerful witches. They fight 
crime! 




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