diff options
author | Estêvão Samuel Procópio <tevaum@gmail.com> | 2010-02-07 00:55:29 +0800 |
---|---|---|
committer | Gustavo Noronha Silva <gns@gnome.org> | 2010-02-07 21:31:19 +0800 |
commit | 544fd66527c6346d8d1646db6527450edfab03ef (patch) | |
tree | dad77f61ca47ba2c5b1b73ae9f9db5ed6cfcbd5d | |
parent | f83f0bea86de27ebd284037a4097ac8bd31db7cf (diff) | |
download | gsoc2013-epiphany-544fd66527c6346d8d1646db6527450edfab03ef.tar gsoc2013-epiphany-544fd66527c6346d8d1646db6527450edfab03ef.tar.gz gsoc2013-epiphany-544fd66527c6346d8d1646db6527450edfab03ef.tar.bz2 gsoc2013-epiphany-544fd66527c6346d8d1646db6527450edfab03ef.tar.lz gsoc2013-epiphany-544fd66527c6346d8d1646db6527450edfab03ef.tar.xz gsoc2013-epiphany-544fd66527c6346d8d1646db6527450edfab03ef.tar.zst gsoc2013-epiphany-544fd66527c6346d8d1646db6527450edfab03ef.zip |
Check for null/empty username and password before saving to gnome-keyring
Bug #608517
-rw-r--r-- | embed/ephy-web-view.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index fb4f66aa6..44143b97e 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1011,11 +1011,8 @@ form_submitted_cb (JSContextRef js_context, name_field_name = js_get_element_attribute (js_context, name_element, "name"); password_field_name = js_get_element_attribute (js_context, password_element, "name"); - if (!name_field_name || !password_field_name) { - g_free (name_field_name); - g_free (password_field_name); - return JSValueMakeUndefined (js_context); - } + if (!name_field_name || !password_field_name) + goto form_submitted_cb_finish; js_string = JSStringCreateWithUTF8CString ("value"); js_value = JSObjectGetProperty (js_context, name_element, js_string, NULL); @@ -1027,19 +1024,21 @@ form_submitted_cb (JSContextRef js_context, password_field_value = js_value_to_string (js_context, js_value); + if (!name_field_value || !password_field_value) + goto form_submitted_cb_finish; + + if (g_str_equal (name_field_value, "") || + g_str_equal (password_field_value, "")) + goto form_submitted_cb_finish; + dummy_object = js_object_get_property_as_object (js_context, js_global, "_EpiphanyInternalDummy"); web_view = JSObjectGetPrivate (dummy_object); uri = soup_uri_new (webkit_web_view_get_uri (web_view)); - if (!uri) { - g_free (name_field_name); - g_free (password_field_name); - g_free (name_field_value); - g_free (password_field_value); - return JSValueMakeUndefined (js_context); - } + if (!uri) + goto form_submitted_cb_finish; // Ignore query string in the uri, if any soup_uri_set_query (uri, NULL); @@ -1062,6 +1061,12 @@ form_submitted_cb (JSContextRef js_context, store_data, NULL); +form_submitted_cb_finish: + g_free (name_field_name); + g_free (password_field_name); + g_free (name_field_value); + g_free (password_field_value); + return JSValueMakeUndefined (js_context); } |