From: Alex Graveley Date: Thu, 23 Aug 2001 10:17:02 +0000 (+0000) Subject: Fix under-allocation. (ntlm_parse): Comment out the NTLM host/domain X-Git-Tag: SOUP_0_4~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31cd3abc7c53d5e021942d79ea633b51eed4335f;p=platform%2Fupstream%2Flibsoup.git Fix under-allocation. (ntlm_parse): Comment out the NTLM host/domain 2001-08-23 Alex Graveley * 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. --- diff --git a/ChangeLog b/ChangeLog index 415c6db..299396c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2001-08-23 Alex Graveley + * 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 + * 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. diff --git a/libsoup/soup-auth.c b/libsoup/soup-auth.c index f3e8193..b3050af 100644 --- a/libsoup/soup-auth.c +++ b/libsoup/soup-auth.c @@ -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; } /*