Merge pull request #166 from i-rinat/auth-ldap-with-no-servers

Require alcf->server array to be non-empty before using it.
main
Valery Komarov 7 years ago committed by GitHub
commit 22f4b32e38
  1. 7
      ngx_http_auth_ldap_module.c

@ -1785,6 +1785,13 @@ ngx_http_auth_ldap_handler(ngx_http_request_t *r)
return NGX_DECLINED;
}
if (alcf->servers == NULL || alcf->servers->nelts == 0) {
/* No LDAP servers for the location. */
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "http_auth_ldap: \"auth_ldap\" requires "
"one or more \"auth_ldap_servers\" in the same location");
return ngx_http_auth_ldap_set_realm(r, &alcf->realm);
}
ctx = ngx_http_get_module_ctx(r, ngx_http_auth_ldap_module);
if (ctx == NULL) {
rc = ngx_http_auth_basic_user(r);

Loading…
Cancel
Save