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

Maxim Dounin mdounin at mdounin.ru
Tue Apr 7 13:03:55 UTC 2015


details:   http://hg.nginx.org/nginx/rev/dfb23e4361da
branches:  stable-1.6
changeset: 6074:dfb23e4361da
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