mirror of
https://github.com/nginx/nginx.git
synced 2025-08-05 22:26:15 +08:00
SPDY: improved ngx_http_spdy_state_save() check.
This commit is contained in:
parent
a4d04f01fb
commit
062e7a0042
@ -1872,14 +1872,16 @@ static u_char *
|
|||||||
ngx_http_spdy_state_save(ngx_http_spdy_connection_t *sc,
|
ngx_http_spdy_state_save(ngx_http_spdy_connection_t *sc,
|
||||||
u_char *pos, u_char *end, ngx_http_spdy_handler_pt handler)
|
u_char *pos, u_char *end, ngx_http_spdy_handler_pt handler)
|
||||||
{
|
{
|
||||||
#if 1
|
size_t size;
|
||||||
if (end - pos > NGX_SPDY_STATE_BUFFER_SIZE) {
|
|
||||||
|
size = end - pos;
|
||||||
|
|
||||||
|
if (size > NGX_SPDY_STATE_BUFFER_SIZE) {
|
||||||
ngx_log_error(NGX_LOG_ALERT, sc->connection->log, 0,
|
ngx_log_error(NGX_LOG_ALERT, sc->connection->log, 0,
|
||||||
"spdy state buffer overflow: "
|
"spdy state buffer overflow: "
|
||||||
"%z bytes required", end - pos);
|
"%z bytes required", end - pos);
|
||||||
return ngx_http_spdy_state_internal_error(sc);
|
return ngx_http_spdy_state_internal_error(sc);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
ngx_memcpy(sc->buffer, pos, NGX_SPDY_STATE_BUFFER_SIZE);
|
ngx_memcpy(sc->buffer, pos, NGX_SPDY_STATE_BUFFER_SIZE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user