Check that the cookie was parsed successfully before setting it
authorChris Lord <chrisl@src.gnome.org>
Mon, 14 Apr 2008 21:15:49 +0000 (21:15 +0000)
committerChris Lord <chrisl@src.gnome.org>
Mon, 14 Apr 2008 21:15:49 +0000 (21:15 +0000)
        * libsoup/soup-cookie-jar.c (soup_cookie_jar_set_cookie):
        Check that the cookie was parsed successfully before setting it

svn path=/trunk/; revision=1136

ChangeLog
libsoup/soup-cookie-jar.c

index 3ef59cb..4c81431 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-04-14  Chris Lord  <chrislord.net@gmail.com>
+
+       reviewed by: Dan Winship <danw@gnome.org>
+
+       * libsoup/soup-cookie-jar.c (soup_cookie_jar_set_cookie):
+       Check that the cookie was parsed successfully before setting it
+
 2008-04-08  Dan Winship  <danw@gnome.org>
 
        Initial HTTP cookie support imported from development git repo,
index 2503f20..46fc1a7 100644 (file)
@@ -263,8 +263,10 @@ soup_cookie_jar_set_cookie (SoupCookieJar *jar, SoupURI *uri,
        g_return_if_fail (cookie != NULL);
 
        soup_cookie = soup_cookie_parse (cookie, uri);
-       set_cookie (jar, soup_cookie);
-       /* set_cookie will steal or free soup_cookie */
+       if (soup_cookie) {
+               set_cookie (jar, soup_cookie);
+               /* set_cookie will steal or free soup_cookie */
+       }
 }
 
 static void