mirror of
https://github.com/nginx/nginx.git
synced 2026-10-24 14:47:45 -05:00
Revert "HTTP/2: fixed overlapping memcpy in CONTINUATION frames"
This reverts commit 2d71bdcf8b.
This is actually unnecessary. Thanks to Valentin Bartenev for the
analysis
1. ngx_http_v2_handle_continuation() handles split HPACK integers at
frame boundaries
2. HPACK integers are max 4 bytes (NGX_HTTP_V2_INT_OCTETS)
3. The function is only called when length < 4 (i.e., 1-3 bytes remain)
4. The copy destination is offset by 9 bytes (frame header size)
Since 3 < 9, source and destination never overlap.
This commit is contained in:
1 parent
42f8df65b6
commit
072f6fdbac
1 file changed
+1
-1
@@ -1967,7 +1967,7 @@ ngx_http_v2_handle_continuation(ngx_http_v2_connection_t *h2c, u_char *pos,
|
||||
p = pos;
|
||||
pos += NGX_HTTP_V2_FRAME_HEADER_SIZE;
|
||||
|
||||
ngx_memmove(pos, p, len);
|
||||
ngx_memcpy(pos, p, len);
|
||||
|
||||
len = ngx_http_v2_parse_length(head);
|
||||
|
||||
|
||||
Reference in new issue
Block a user