changeset 5870:5e72578e6503

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 fd283aa92e04
children 21043ce2a005
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; "