From: Joe Orton Date: Thu, 23 Jun 2005 10:27:27 +0000 (+0000) Subject: * modules/aaa/mod_auth_digest.c: Another gcc 4 "structure field may be X-Git-Tag: 2.1.6~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d67cf94f72f42ff5635f4d28249fe32854aa36ab;p=thirdparty%2Fapache%2Fhttpd.git * modules/aaa/mod_auth_digest.c: Another gcc 4 "structure field may be used uninitialized" warning; fix validation of digest-uri for CONNECT requests: (copy_uri_components): Copy the hostinfo field. (authenticate_digest_user): Don't pass NULL (or, previously, a random pointer) to strcmp if a digest-uri is provided which doesn't match the request-uri in a CONNECT request. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@193127 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c index 9756ac2611f..395fee0711a 100644 --- a/modules/aaa/mod_auth_digest.c +++ b/modules/aaa/mod_auth_digest.c @@ -1575,6 +1575,8 @@ static void copy_uri_components(apr_uri_t *dst, else { dst->query = src->query; } + + dst->hostinfo = src->hostinfo; } /* These functions return 0 if client is OK, and proper error status @@ -1709,7 +1711,7 @@ static int authenticate_digest_user(request_rec *r) } if (r->method_number == M_CONNECT) { - if (strcmp(resp->uri, r_uri.hostinfo)) { + if (!r_uri.hostinfo || strcmp(resp->uri, r_uri.hostinfo)) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Digest: uri mismatch - <%s> does not match " "request-uri <%s>", resp->uri, r_uri.hostinfo);