# HG changeset patch # User Valentin Bartenev # Date 1395841419 -14400 # Node ID 372cc6e532a6d70f66be64e31f8a73d19ca1889c # Parent bd91f286ee0ade98e9c0f8f55bfef54a122adaf2 SPDY: detect premature end of frame while start parsing headers. diff -r bd91f286ee0a -r 372cc6e532a6 src/http/ngx_http_spdy.c --- a/src/http/ngx_http_spdy.c Mon Mar 24 16:35:44 2014 -0700 +++ b/src/http/ngx_http_spdy.c Wed Mar 26 17:43:39 2014 +0400 @@ -1049,6 +1049,15 @@ if (r->headers_in.headers.part.elts == NULL) { if (buf->last - buf->pos < NGX_SPDY_NV_NUM_SIZE) { + + if (complete) { + ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, + "client sent SYN_STREAM frame " + "with invalid HEADERS block"); + ngx_http_spdy_close_stream(sc->stream, NGX_HTTP_BAD_REQUEST); + return ngx_http_spdy_state_protocol_error(sc); + } + return ngx_http_spdy_state_save(sc, pos, end, ngx_http_spdy_state_headers); }