[libsoup] soup-cookie-jar: avoid a g_return_if_fail when using non-http URIs



commit 2ee3d2d1aef0eb6aada232dfc0c912f1b5abfbb2
Author: Dan Winship <danw gnome org>
Date:   Thu Mar 10 19:59:07 2011 -0500

    soup-cookie-jar: avoid a g_return_if_fail when using non-http URIs
    
    When using SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY, don't try to
    domain-match the cookie if the first_party URI has no domain.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=643226

 libsoup/soup-cookie-jar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libsoup/soup-cookie-jar.c b/libsoup/soup-cookie-jar.c
index c1735dc..88fe731 100644
--- a/libsoup/soup-cookie-jar.c
+++ b/libsoup/soup-cookie-jar.c
@@ -564,7 +564,7 @@ process_set_cookie_header (SoupMessage *msg, gpointer user_data)
 		SoupURI *first_party = soup_message_get_first_party (msg);
 		
 		if ((priv->accept_policy == SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY &&
-		     first_party != NULL &&
+		     first_party != NULL && first_party->host &&
 		     soup_cookie_domain_matches (nc->data, first_party->host)) ||
 		    priv->accept_policy == SOUP_COOKIE_JAR_ACCEPT_ALWAYS)
 			soup_cookie_jar_add_cookie (jar, nc->data);



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