]> git.kaiwu.me - nginx.git/commitdiff
Core: fixed buffer overrun when hash max_size reached.
authorYichun Zhang <agentzh@gmail.com>
Thu, 2 Oct 2014 19:00:17 +0000 (12:00 -0700)
committerYichun Zhang <agentzh@gmail.com>
Thu, 2 Oct 2014 19:00:17 +0000 (12:00 -0700)
src/core/ngx_hash.c

index c7bfed709798fe51adf4aa390adbfbc2520d4229..65ad83947964be426de7a16a8d0c0c9d460624de 100644 (file)
@@ -312,6 +312,8 @@ ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
         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; "