mirror of
https://github.com/mainnika/nginx-auth-ldap.git
synced 2026-06-12 18:03:36 +00:00
Checking if ldap_server is defined before auth_ldap_servers. Getting segfault without this check.
This commit is contained in:
@@ -439,6 +439,12 @@ ngx_http_auth_ldap_servers(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
value = &((ngx_str_t *) cf->args->elts)[i];
|
value = &((ngx_str_t *) cf->args->elts)[i];
|
||||||
server = NULL;
|
server = NULL;
|
||||||
|
|
||||||
|
if (mconf->servers == NULL) {
|
||||||
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "http_auth_ldap: Using \"auth_ldap_servers\" when no \"ldap_server\" has been previously defined"
|
||||||
|
" (make sure that \"auth_ldap_servers\" goes after \"ldap_server\"s in your configuration file)", value);
|
||||||
|
return NGX_CONF_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
for (j = 0; j < mconf->servers->nelts; j++) {
|
for (j = 0; j < mconf->servers->nelts; j++) {
|
||||||
s = &((ngx_http_auth_ldap_server_t *) mconf->servers->elts)[j];
|
s = &((ngx_http_auth_ldap_server_t *) mconf->servers->elts)[j];
|
||||||
if (s->alias.len == value->len && ngx_memcmp(s->alias.data, value->data, s->alias.len) == 0) {
|
if (s->alias.len == value->len && ngx_memcmp(s->alias.data, value->data, s->alias.len) == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user