[empathy] Validate parameters to fixup_url() and empathy_url_show()
- From: Davyd Madeley <davyd src gnome org>
- To: svn-commits-list gnome org
- Subject: [empathy] Validate parameters to fixup_url() and empathy_url_show()
- Date: Fri, 17 Jul 2009 16:09:18 +0000 (UTC)
commit 6e60fdb3583e4072961a72148fe396885d037dcb
Author: Nicolò Chieffo <nicolo chieffo gmail com>
Date: Fri Jul 17 17:58:08 2009 +0200
Validate parameters to fixup_url() and empathy_url_show()
Using g_return{_val,}_if_fail(). Extra validation added by Davyd Madeley.
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 e91ac62..2218533 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
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]