mirror of
https://github.com/nginx/nginx.git
synced 2024-12-22 15:13:28 -06:00
Geo: fixed access to already freed memory.
Previously, in "ranges" mode when all added ranges were deleted, the ctx.high.low[i] was left pointing to a temporary array.
This commit is contained in:
parent
50ba1a2cde
commit
535550b406
@ -469,7 +469,12 @@ ngx_http_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
for (i = 0; i < 0x10000; i++) {
|
||||
a = (ngx_array_t *) ctx.high.low[i];
|
||||
|
||||
if (a == NULL || a->nelts == 0) {
|
||||
if (a == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (a->nelts == 0) {
|
||||
ctx.high.low[i] = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -436,7 +436,12 @@ ngx_stream_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
for (i = 0; i < 0x10000; i++) {
|
||||
a = (ngx_array_t *) ctx.high.low[i];
|
||||
|
||||
if (a == NULL || a->nelts == 0) {
|
||||
if (a == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (a->nelts == 0) {
|
||||
ctx.high.low[i] = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user