]> git.kaiwu.me - nginx.git/commitdiff
HTTP/2: emit PROTOCOL_ERROR on padding errors.
authorPiotr Sikora <piotrsikora@google.com>
Sun, 26 Mar 2017 08:25:05 +0000 (01:25 -0700)
committerPiotr Sikora <piotrsikora@google.com>
Sun, 26 Mar 2017 08:25:05 +0000 (01:25 -0700)
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
src/http/v2/ngx_http_v2.c

index e17af9ac40e7af046f4985de935c9d89a66e6c94..ee9ceb0bddf222bdf5cf4d13f5bf8fa29962ef1c 100644 (file)
@@ -812,7 +812,8 @@ ngx_http_v2_state_data(ngx_http_v2_connection_t *h2c, u_char *pos, u_char *end)
                           "with incorrect length: %uz, padding: %uz",
                           size, h2c->state.padding);
 
-            return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_SIZE_ERROR);
+            return ngx_http_v2_connection_error(h2c,
+                                                NGX_HTTP_V2_PROTOCOL_ERROR);
         }
 
         h2c->state.length -= 1 + h2c->state.padding;
@@ -1055,7 +1056,8 @@ ngx_http_v2_state_headers(ngx_http_v2_connection_t *h2c, u_char *pos,
                           "with incorrect length: %uz, padding: %uz",
                           h2c->state.length, h2c->state.padding);
 
-            return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_SIZE_ERROR);
+            return ngx_http_v2_connection_error(h2c,
+                                                NGX_HTTP_V2_PROTOCOL_ERROR);
         }
 
         h2c->state.length -= h2c->state.padding;