Geo: fixed overflow when iterating over ranges.

This commit is contained in:
Ruslan Ermilov 2016-08-23 15:57:29 +03:00
parent 218c8d493f
commit 36e1c887db
2 changed files with 20 additions and 4 deletions

View File

@ -946,7 +946,9 @@ ngx_http_geo_add_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
next:
continue;
if (h == 0xffff) {
break;
}
}
return NGX_CONF_OK;
@ -985,7 +987,7 @@ ngx_http_geo_delete_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
if (a == NULL) {
warn = 1;
continue;
goto next;
}
range = a->elts;
@ -1010,6 +1012,12 @@ ngx_http_geo_delete_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
warn = 1;
}
next:
if (h == 0xffff) {
break;
}
}
return warn;

View File

@ -896,7 +896,9 @@ ngx_stream_geo_add_range(ngx_conf_t *cf, ngx_stream_geo_conf_ctx_t *ctx,
next:
continue;
if (h == 0xffff) {
break;
}
}
return NGX_CONF_OK;
@ -935,7 +937,7 @@ ngx_stream_geo_delete_range(ngx_conf_t *cf, ngx_stream_geo_conf_ctx_t *ctx,
if (a == NULL) {
warn = 1;
continue;
goto next;
}
range = a->elts;
@ -960,6 +962,12 @@ ngx_stream_geo_delete_range(ngx_conf_t *cf, ngx_stream_geo_conf_ctx_t *ctx,
warn = 1;
}
next:
if (h == 0xffff) {
break;
}
}
return warn;