Re: [PATCH] NULL check in gnome_vfs_uri_to_string()



On Wed, 2004-10-06 at 08:04 +0200, Martin Wehner wrote:
> gnome_vfs_uri_to_string() doesn't handle uri == NULL gracefully (certain
> segfault). There are some bugs in bugzilla (in various modules) which
> crash here. While I agree that the callers need to be fixed too, gnome-
> vfs should handle this more defensively.

If we really want to handle this we should do a normal comparison like:
if (uri == NULL)
  return NULL;

after the g_return_val_if_fail, because g_return_* can be optionally
disabled at compile time and should not be relied on as the guaranteed
runtime behaviour.

Please go ahead and commit with that change.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an old-fashioned day-dreaming Green Beret with nothing left to lose. 
She's a pregnant French-Canadian journalist on her way to prison for a murder 
she didn't commit. They fight crime! 




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