Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4405 - trunk/src/core

Anonymous User
January 16, 2012 07:44AM
Author: vbart
Date: 2012-01-16 12:42:07 +0000 (Mon, 16 Jan 2012)
New Revision: 4405

Modified:
trunk/src/core/ngx_hash.c
Log:
Fixed devision by zero exception in ngx_hash_init().

The ngx_hash_init() function did not expect call with zero elements count,
which caused FPE error on configs with an empty "types" block in http context
and "types_hash_max_size" > 10000.

Example configuration to reproduce:

events { }

http {
types_hash_max_size 10001;
types {}
server {}
}



Modified: trunk/src/core/ngx_hash.c
===================================================================
--- trunk/src/core/ngx_hash.c 2012-01-16 11:13:48 UTC (rev 4404)
+++ trunk/src/core/ngx_hash.c 2012-01-16 12:42:07 UTC (rev 4405)
@@ -277,7 +277,7 @@
start = nelts / (bucket_size / (2 * sizeof(void *)));
start = start ? start : 1;

- if (hinit->max_size > 10000 && hinit->max_size / nelts < 100) {
+ if (hinit->max_size > 10000 && nelts && hinit->max_size / nelts < 100) {
start = hinit->max_size - 1000;
}


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4405 - trunk/src/core

Anonymous User 1278 January 16, 2012 07:44AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 190
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready