diff options
| author | Maxim Dounin <mdounin@mdounin.ru> | 2014-03-19 12:57:39 +0400 |
|---|---|---|
| committer | Maxim Dounin <mdounin@mdounin.ru> | 2014-03-19 12:57:39 +0400 |
| commit | 062e7a00426e14a116446b71c1418f29796e672b (patch) | |
| tree | 4c04781eefed9f81402799236a3fa37ff85caa3e /src | |
| parent | a4d04f01fb70563146f5fee0ae61b7c4c5a9b45a (diff) | |
| download | nginx-062e7a00426e14a116446b71c1418f29796e672b.tar.gz nginx-062e7a00426e14a116446b71c1418f29796e672b.tar.bz2 | |
SPDY: improved ngx_http_spdy_state_save() check.
Diffstat (limited to '')
| -rw-r--r-- | src/http/ngx_http_spdy.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/http/ngx_http_spdy.c b/src/http/ngx_http_spdy.c index 6e45f4b46..24772bd2e 100644 --- a/src/http/ngx_http_spdy.c +++ b/src/http/ngx_http_spdy.c @@ -1872,14 +1872,16 @@ static u_char * ngx_http_spdy_state_save(ngx_http_spdy_connection_t *sc, u_char *pos, u_char *end, ngx_http_spdy_handler_pt handler) { -#if 1 - if (end - pos > NGX_SPDY_STATE_BUFFER_SIZE) { + size_t size; + + size = end - pos; + + if (size > NGX_SPDY_STATE_BUFFER_SIZE) { ngx_log_error(NGX_LOG_ALERT, sc->connection->log, 0, "spdy state buffer overflow: " "%z bytes required", end - pos); return ngx_http_spdy_state_internal_error(sc); } -#endif ngx_memcpy(sc->buffer, pos, NGX_SPDY_STATE_BUFFER_SIZE); |
