# HG changeset patch # User Yichun Zhang # Date 1406324609 25200 # Node ID 494c2c2a0247674b5e4d3b8d276091aae56b4c1d # Parent d421be0d842ad2e9e6674d5cdb73337415d2f3e0 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. diff -r d421be0d842a -r 494c2c2a0247 src/http/modules/ngx_http_geoip_module.c --- a/src/http/modules/ngx_http_geoip_module.c Thu Jun 26 23:39:23 2014 -0700 +++ b/src/http/modules/ngx_http_geoip_module.c Fri Jul 25 14:43:29 2014 -0700 @@ -553,6 +553,9 @@ 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 @@ 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);