Welcome! Log In Create A New Profile

Advanced

Re: a bug in limit_request module

September 03, 2012 09:38AM
On Wednesday 22 August 2012 17:49:52 chen cw wrote:
> Hi,
> The red-black tree used in limit_request module has two level of
> keys, the top is hash, and the next is the value string itself. However,
> when inserting a new node into the tree, only hash is set, the value string
> is left empty, as such code shows the whole thing:
>
> 445: node->key = hash;
> 446:
> 447: ngx_rbtree_insert(&ctx->sh->rbtree, node);
> 448:
> 449: lr = (ngx_http_limit_req_node_t *) &node->color;
> 450:
> 451: ngx_queue_insert_head(&ctx->sh->queue, &lr->queue);
> 452:
> 453: lr->len = (u_char) len;
> 454: lr->excess = 0;
> 455:
> 456: ngx_memcpy(lr->data, data, len);
>
> So there are chances nginx inserts a node which the value string
> is large, into the left sub tree.
>
> The bugfix is to move line 447 to under line 456.
>

Thanks, the fix was committed as r4833.

wbr, Valentin V. Bartenev

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

a bug in limit_request module

chen cw 1450 August 22, 2012 09:52AM

Re: a bug in limit_request module

VBart 1125 August 22, 2012 10:56AM

Re: a bug in limit_request module

Maxim Dounin 635 September 01, 2012 05:26AM

Re: a bug in limit_request module

VBart 1184 September 03, 2012 09:38AM



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

Online Users

Guests: 168
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