[nginx] Core: fixed buffer overrun when hash max_size reached.

Maxim Dounin mdounin at mdounin.ru
Wed Oct 8 13:41:44 UTC 2014


details:   http://hg.nginx.org/nginx/rev/5e72578e6503
branches:  
changeset: 5870:5e72578e6503
user:      Yichun Zhang <agentzh at gmail.com>
date:      Thu Oct 02 12:00:17 2014 -0700
description:
Core: fixed buffer overrun when hash max_size reached.

diffstat:

 src/core/ngx_hash.c |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff --git a/src/core/ngx_hash.c b/src/core/ngx_hash.c
--- 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; "



More information about the nginx-devel mailing list