comparison src/http/modules/ngx_http_userid_filter_module.c @ 7028:e6f399a176e7

Userid: ngx_http_get_indexed_variable() error handling. When evaluating a mapped $reset_uid variable in the userid filter, if get_handler set to ngx_http_map_variable() returned an error, this previously resulted in a NULL pointer dereference.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 07 Jun 2017 18:46:36 +0300
parents b3682580c1bd
children ecc97cb0eda4
comparison
equal deleted inserted replaced
7027:6d0e0d982ec0 7028:e6f399a176e7
470 470
471 if (ctx->uid_got[3] != 0) { 471 if (ctx->uid_got[3] != 0) {
472 472
473 vv = ngx_http_get_indexed_variable(r, ngx_http_userid_reset_index); 473 vv = ngx_http_get_indexed_variable(r, ngx_http_userid_reset_index);
474 474
475 if (vv == NULL || vv->not_found) {
476 return NGX_ERROR;
477 }
478
475 if (vv->len == 0 || (vv->len == 1 && vv->data[0] == '0')) { 479 if (vv->len == 0 || (vv->len == 1 && vv->data[0] == '0')) {
476 480
477 if (conf->mark == '\0' 481 if (conf->mark == '\0'
478 || (ctx->cookie.len > 23 482 || (ctx->cookie.len > 23
479 && ctx->cookie.data[22] == conf->mark 483 && ctx->cookie.data[22] == conf->mark