mirror of
https://github.com/nginx/nginx.git
synced 2024-12-11 17:59:00 +08:00
GeoIP: not all variable fields were initialized.
The ngx_http_geoip_city_float_variable and ngx_http_geoip_city_int_variable functions did not always initialize all variable fields like "not_found", which could lead to empty values for those corresponding nginx variables randomly.
This commit is contained in:
parent
3ba8f2f73d
commit
7b24c53efe
@ -553,6 +553,9 @@ ngx_http_geoip_city_float_variable(ngx_http_request_t *r,
|
||||
val = *(float *) ((char *) gr + data);
|
||||
|
||||
v->len = ngx_sprintf(v->data, "%.4f", val) - v->data;
|
||||
v->valid = 1;
|
||||
v->no_cacheable = 0;
|
||||
v->not_found = 0;
|
||||
|
||||
GeoIPRecord_delete(gr);
|
||||
|
||||
@ -582,6 +585,9 @@ ngx_http_geoip_city_int_variable(ngx_http_request_t *r,
|
||||
val = *(int *) ((char *) gr + data);
|
||||
|
||||
v->len = ngx_sprintf(v->data, "%d", val) - v->data;
|
||||
v->valid = 1;
|
||||
v->no_cacheable = 0;
|
||||
v->not_found = 0;
|
||||
|
||||
GeoIPRecord_delete(gr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user