diff options
author | Joe Orton <jorton@apache.org> | 2004-03-04 08:59:30 +0100 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2004-03-04 08:59:30 +0100 |
commit | 3f586951414b9b80834c5a8cc8a5b4cc0bfcb59f (patch) | |
tree | 0ba7d468536ec53bd830ff15ee0897c0697eb935 | |
parent | sync with 2.0.49-dev (diff) | |
download | apache2-3f586951414b9b80834c5a8cc8a5b4cc0bfcb59f.tar.xz apache2-3f586951414b9b80834c5a8cc8a5b4cc0bfcb59f.zip |
* modules/ssl/ssl_engine_vars (ssl_var_lookup): Fix potential
segfaults if called with r=NULL, c!=NULL, spotted by Andr��.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102849 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | modules/ssl/ssl_engine_vars.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/ssl/ssl_engine_vars.c b/modules/ssl/ssl_engine_vars.c index 4d3ba48072..c33afc05bd 100644 --- a/modules/ssl/ssl_engine_vars.c +++ b/modules/ssl/ssl_engine_vars.c @@ -130,6 +130,10 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, result = apr_psprintf(p, "%u", ap_get_server_port(r)); else if (strcEQ(var, "SERVER_PROTOCOL")) result = r->protocol; + else if (strcEQ(var, "REMOTE_USER")) + result = r->user; + else if (strcEQ(var, "AUTH_TYPE")) + result = r->ap_auth_type; } /* @@ -139,10 +143,6 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, SSLConnRec *sslconn = myConnConfig(c); if (strcEQ(var, "REMOTE_ADDR")) result = c->remote_ip; - else if (strcEQ(var, "REMOTE_USER")) - result = r->user; - else if (strcEQ(var, "AUTH_TYPE")) - result = r->ap_auth_type; else if (strlen(var) > 4 && strcEQn(var, "SSL_", 4) && sslconn && sslconn->ssl) result = ssl_var_lookup_ssl(p, c, var+4); |