diff options
author | Nicolò Chieffo <nicolo.chieffo@gmail.com> | 2009-07-17 23:58:08 +0800 |
---|---|---|
committer | Davyd Madeley <davyd@madeley.id.au> | 2009-07-18 00:07:43 +0800 |
commit | 6e60fdb3583e4072961a72148fe396885d037dcb (patch) | |
tree | 8d9483bb2b84d63e36970809f1296b4b282adde0 /libempathy-gtk | |
parent | 1246403f33f502ad3959f56d5ec1c2674b1b4ac8 (diff) | |
download | gsoc2013-empathy-6e60fdb3583e4072961a72148fe396885d037dcb.tar gsoc2013-empathy-6e60fdb3583e4072961a72148fe396885d037dcb.tar.gz gsoc2013-empathy-6e60fdb3583e4072961a72148fe396885d037dcb.tar.bz2 gsoc2013-empathy-6e60fdb3583e4072961a72148fe396885d037dcb.tar.lz gsoc2013-empathy-6e60fdb3583e4072961a72148fe396885d037dcb.tar.xz gsoc2013-empathy-6e60fdb3583e4072961a72148fe396885d037dcb.tar.zst gsoc2013-empathy-6e60fdb3583e4072961a72148fe396885d037dcb.zip |
Validate parameters to fixup_url() and empathy_url_show()
Using g_return{_val,}_if_fail(). Extra validation added by Davyd Madeley.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-ui-utils.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c index e91ac6291..2218533f5 100644 --- a/libempathy-gtk/empathy-ui-utils.c +++ b/libempathy-gtk/empathy-ui-utils.c @@ -1341,6 +1341,8 @@ empathy_get_toplevel_window (GtkWidget *widget) static gchar * fixup_url (const gchar *url) { + g_return_val_if_fail (url != NULL, NULL); + if (g_str_has_prefix (url, "ghelp:") || g_str_has_prefix (url, "mailto:") || strstr (url, ":/")) { @@ -1361,6 +1363,9 @@ empathy_url_show (GtkWidget *parent, gchar *real_url; GError *error = NULL; + g_return_if_fail (GTK_IS_WIDGET (parent)); + g_return_if_fail (url != NULL); + real_url = fixup_url (url); if (real_url) { url = real_url; @@ -1539,4 +1544,4 @@ empathy_receive_file_with_file_chooser (EmpathyFTHandler *handler) G_CALLBACK (file_manager_receive_file_response_cb), handler); gtk_widget_show (widget); -}
\ No newline at end of file +} |