Welcome! Log In Create A New Profile

Advanced

[nginx] GeoIP: not all variable fields were initialized.

Maxim Dounin
July 27, 2014 10:18PM
details: http://hg.nginx.org/nginx/rev/494c2c2a0247
branches:
changeset: 5773:494c2c2a0247
user: Yichun Zhang <agentzh@gmail.com>
date: Fri Jul 25 14:43:29 2014 -0700
description:
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.

diffstat:

src/http/modules/ngx_http_geoip_module.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diffs (23 lines):

diff --git a/src/http/modules/ngx_http_geoip_module.c b/src/http/modules/ngx_http_geoip_module.c
--- a/src/http/modules/ngx_http_geoip_module.c
+++ b/src/http/modules/ngx_http_geoip_module.c
@@ -553,6 +553,9 @@ ngx_http_geoip_city_float_variable(ngx_h
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_htt
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);


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] GeoIP: not all variable fields were initialized.

Maxim Dounin 627 July 27, 2014 10:18PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 301
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready