Don't crash if the authenticate callback returns a username and no
authorDan Winship <danw@src.gnome.org>
Fri, 5 Oct 2007 15:51:27 +0000 (15:51 +0000)
committerDan Winship <danw@src.gnome.org>
Fri, 5 Oct 2007 15:51:27 +0000 (15:51 +0000)
* libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Don't crash
if the authenticate callback returns a username and no password
(even though it's not supposed to do that). #480987

svn path=/trunk/; revision=935

ChangeLog
libsoup/soup-connection-ntlm.c

index 84d5aeb..fbcc8ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-10-05  Dan Winship  <danw@gnome.org>
+
+       * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Don't crash
+       if the authenticate callback returns a username and no password
+       (even though it's not supposed to do that). #480987
+
 2007-09-24  Dan Winship  <danw@gnome.org>
 
        * libsoup/soup-auth.h (SoupAuth): add "realm" field to the struct.
index 0550922..1ffb66b 100644 (file)
@@ -115,9 +115,11 @@ ntlm_authorize_pre (SoupMessage *msg, gpointer user_data)
        soup_connection_authenticate (SOUP_CONNECTION (ntlm), msg,
                                      "NTLM", domain,
                                      &domain_username, &password);
-       if (!domain_username) {
+       if (!domain_username || !password) {
                g_free (nonce);
                g_free (domain);
+               g_free (domain_username);
+               g_free (password);
                goto done;
        }