mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
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.
This commit is contained in:
parent
e4209c0269
commit
6d7ec5009a
@ -178,12 +178,12 @@ valid_scheme:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf[i] = ngx_tolower(*p);
|
|
||||||
key = ngx_hash(key, buf[i++]);
|
|
||||||
|
|
||||||
if (i == 256) {
|
if (i == 256) {
|
||||||
goto invalid;
|
goto invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buf[i] = ngx_tolower(*p);
|
||||||
|
key = ngx_hash(key, buf[i++]);
|
||||||
}
|
}
|
||||||
|
|
||||||
uri = ngx_hash_find_combined(&rlcf->hash, key, buf, p - ref);
|
uri = ngx_hash_find_combined(&rlcf->hash, key, buf, p - ref);
|
||||||
|
Loading…
Reference in New Issue
Block a user