Fix under-allocation. (ntlm_parse): Comment out the NTLM host/domain
authorAlex Graveley <alex@ximian.com>
Thu, 23 Aug 2001 10:17:02 +0000 (10:17 +0000)
committerAlex Graveley <orph@src.gnome.org>
Thu, 23 Aug 2001 10:17:02 +0000 (10:17 +0000)
2001-08-23  Alex Graveley  <alex@ximian.com>

* src/soup-core/soup-auth.c (ntlm_new): Fix under-allocation.
(ntlm_parse): Comment out the NTLM host/domain parsing code, as it
segfaults for some reason. Not that this matters as IIS seems to
competely ignore these parts of the NTLM message :) There is also
some memory corruption in soup-ntlm.c causing segfaults after the
message-finished callback returns.

ChangeLog
libsoup/soup-auth.c

index 415c6db..299396c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2001-08-23  Alex Graveley  <alex@ximian.com>
 
+       * src/soup-core/soup-auth.c (ntlm_new): Fix under-allocation.
+       (ntlm_parse): Comment out the NTLM host/domain parsing code, as it
+       segfaults for some reason. Not that this matters as IIS seems to
+       competely ignore these parts of the NTLM message :) There is also
+       some memory corruption in soup-ntlm.c causing segfaults after the
+       message-finished callback returns.
+
+2001-08-23  Alex Graveley  <alex@ximian.com>
+
        * src/soup-core/soup-auth.c (soup_auth_invalidates_prior): Add
        SoupAuth.compare_func and call this from here, to remove hardcoded
        auth scheme knowledge.
index f3e8193..b3050af 100644 (file)
@@ -510,8 +510,9 @@ ntlm_parse (SoupAuth *sa, const char *header)
 {
        SoupAuthNTLM *auth = (SoupAuthNTLM *) sa;
        const SoupUri *uri = soup_context_get_uri (auth->auth.context);
-       gchar *idx, *host, *domain = NULL;
+       gchar *idx, *host = NULL, *domain = NULL;
 
+       /*
        idx = strchr (uri->host, '.');
        if (idx)
                host = g_strndup (uri->host, idx - uri->host);
@@ -533,7 +534,13 @@ ntlm_parse (SoupAuth *sa, const char *header)
                }
        }
 
-       if (strlen (header) > sizeof ("NTLM"))
+       soup_debug_print_uri (uri);
+       */
+
+       host = "FAKEHOST";
+       domain = "FAKEDOMAIN";
+
+       if (strlen (header) < sizeof ("NTLM"))
                auth->request = soup_ntlm_request (host, 
                                                   domain ? domain : "UNKNOWN");
        else {
@@ -551,8 +558,10 @@ ntlm_parse (SoupAuth *sa, const char *header)
                                            domain ? domain : "UNKNOWN");
        }
 
+       /*
        g_free (host);
        g_free (domain);
+       */
 }
 
 static void
@@ -568,16 +577,16 @@ ntlm_free (SoupAuth *sa)
 static SoupAuth *
 ntlm_new (void)
 {
-       SoupAuth *auth;
+       SoupAuthNTLM *auth;
 
-       auth = g_new0 (SoupAuth, 1);
-       auth->type = SOUP_AUTH_NTLM;
-       auth->compare_func = ntlm_compare_func;
-       auth->parse_func = ntlm_parse;
-       auth->auth_func = ntlm_auth;
-       auth->free_func = ntlm_free;
+       auth = g_new0 (SoupAuthNTLM, 1);
+       auth->auth.type = SOUP_AUTH_NTLM;
+       auth->auth.compare_func = ntlm_compare_func;
+       auth->auth.parse_func = ntlm_parse;
+       auth->auth.auth_func = ntlm_auth;
+       auth->auth.free_func = ntlm_free;
 
-       return auth;
+       return (SoupAuth *) auth;
 }
 
 /*