Welcome! Log In Create A New Profile

Advanced

[nginx] Geo: fixed overflow when iterating over ranges.

August 23, 2016 10:02AM
details: http://hg.nginx.org/nginx/rev/ec141a44641b
branches:
changeset: 6661:ec141a44641b
user: Ruslan Ermilov <ru@nginx.com>
date: Tue Aug 23 15:57:29 2016 +0300
description:
Geo: fixed overflow when iterating over ranges.

diffstat:

src/http/modules/ngx_http_geo_module.c | 12 ++++++++++--
src/stream/ngx_stream_geo_module.c | 12 ++++++++++--
2 files changed, 20 insertions(+), 4 deletions(-)

diffs (72 lines):

diff -r 3eb1a92a2f05 -r ec141a44641b src/http/modules/ngx_http_geo_module.c
--- a/src/http/modules/ngx_http_geo_module.c Mon Aug 22 18:53:21 2016 +0300
+++ b/src/http/modules/ngx_http_geo_module.c Tue Aug 23 15:57:29 2016 +0300
@@ -946,7 +946,9 @@ ngx_http_geo_add_range(ngx_conf_t *cf, n

next:

- continue;
+ if (h == 0xffff) {
+ break;
+ }
}

return NGX_CONF_OK;
@@ -985,7 +987,7 @@ ngx_http_geo_delete_range(ngx_conf_t *cf

if (a == NULL) {
warn = 1;
- continue;
+ goto next;
}

range = a->elts;
@@ -1010,6 +1012,12 @@ ngx_http_geo_delete_range(ngx_conf_t *cf

warn = 1;
}
+
+ next:
+
+ if (h == 0xffff) {
+ break;
+ }
}

return warn;
diff -r 3eb1a92a2f05 -r ec141a44641b src/stream/ngx_stream_geo_module.c
--- a/src/stream/ngx_stream_geo_module.c Mon Aug 22 18:53:21 2016 +0300
+++ b/src/stream/ngx_stream_geo_module.c Tue Aug 23 15:57:29 2016 +0300
@@ -896,7 +896,9 @@ ngx_stream_geo_add_range(ngx_conf_t *cf,

next:

- continue;
+ if (h == 0xffff) {
+ break;
+ }
}

return NGX_CONF_OK;
@@ -935,7 +937,7 @@ ngx_stream_geo_delete_range(ngx_conf_t *

if (a == NULL) {
warn = 1;
- continue;
+ goto next;
}

range = a->elts;
@@ -960,6 +962,12 @@ ngx_stream_geo_delete_range(ngx_conf_t *

warn = 1;
}
+
+ next:
+
+ if (h == 0xffff) {
+ break;
+ }
}

return warn;

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

[nginx] Geo: fixed overflow when iterating over ranges.

ru@nginx.com 671 August 23, 2016 10:02AM



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

Online Users

Guests: 260
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready