changeset 6074:dfb23e4361da stable-1.6

Core: fixed buffer overrun when hash max_size reached.
author Yichun Zhang <agentzh@gmail.com>
date Thu, 02 Oct 2014 12:00:17 -0700
parents 8bc8eb8abfae
children 7fcfe113827d
files src/core/ngx_hash.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/ngx_hash.c
+++ b/src/core/ngx_hash.c
@@ -312,6 +312,8 @@ ngx_hash_init(ngx_hash_init_t *hinit, ng
         continue;
     }
 
+    size--;
+
     ngx_log_error(NGX_LOG_WARN, hinit->pool->log, 0,
                   "could not build optimal %s, you should increase "
                   "either %s_max_size: %i or %s_bucket_size: %i; "