# HG changeset patch # User Valentin Bartenev # Date 1377801354 -14400 # Node ID ec0be12c8e29108cbce54e6fadc6d5554dfac948 # Parent a2c772963b0486313f981819ec0de94480695a22 Referer: fixed hostname buffer overflow check. Because of premature check the effective buffer size was 255 symbols while the buffer is able to handle 256. diff -r a2c772963b04 -r ec0be12c8e29 src/http/modules/ngx_http_referer_module.c --- a/src/http/modules/ngx_http_referer_module.c Thu Aug 29 22:35:27 2013 +0400 +++ b/src/http/modules/ngx_http_referer_module.c Thu Aug 29 22:35:54 2013 +0400 @@ -178,12 +178,12 @@ break; } - buf[i] = ngx_tolower(*p); - key = ngx_hash(key, buf[i++]); - if (i == 256) { goto invalid; } + + buf[i] = ngx_tolower(*p); + key = ngx_hash(key, buf[i++]); } uri = ngx_hash_find_combined(&rlcf->hash, key, buf, p - ref);