aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGustavo Noronha Silva <gns@gnome.org>2009-12-20 08:19:47 +0800
committerGustavo Noronha Silva <gns@gnome.org>2009-12-20 08:20:59 +0800
commit906b29252ccc045ff7f895bcb5fabd2be5d60c92 (patch)
tree798bcd3bd4b31ef212965052e8a54e9856fbe3b6 /lib
parent40c0d516e3cac6d41a60eaf8d939522572b8e2c2 (diff)
downloadgsoc2013-epiphany-906b29252ccc045ff7f895bcb5fabd2be5d60c92.tar.gz
gsoc2013-epiphany-906b29252ccc045ff7f895bcb5fabd2be5d60c92.tar.zst
gsoc2013-epiphany-906b29252ccc045ff7f895bcb5fabd2be5d60c92.zip
Add sanity checks for places where we create SoupURIs
SoupURI creation may fail for invalid URIs, and we would crash trying to work with the NULL pointers.
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-profile-migration.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ephy-profile-migration.c b/lib/ephy-profile-migration.c
index b5a32f17f..01a4a20f7 100644
--- a/lib/ephy-profile-migration.c
+++ b/lib/ephy-profile-migration.c
@@ -431,6 +431,8 @@ normalize_and_prepare_uri (SoupURI *uri,
const char *form_username,
const char *form_password)
{
+ g_return_if_fail (uri != NULL);
+
/* We normalize https? schemes here so that we use passwords
* we stored in https sites in their http counterparts, and
* vice-versa. */
@@ -464,6 +466,9 @@ _ephy_profile_store_form_auth_data (const char *uri,
g_return_if_fail (password);
fake_uri = soup_uri_new (uri);
+ if (fake_uri == NULL)
+ return;
+
normalize_and_prepare_uri (fake_uri, form_username, form_password);
fake_uri_str = soup_uri_to_string (fake_uri, FALSE);
@@ -500,6 +505,9 @@ _ephy_profile_query_form_auth_data (const char *uri,
g_return_val_if_fail (form_password, NULL);
key = soup_uri_new (uri);
+ if (key == NULL)
+ return NULL;
+
normalize_and_prepare_uri (key, form_username, form_password);
key_str = soup_uri_to_string (key, FALSE);