diff --git a/src/node_http2.cc b/src/node_http2.cc index 593c8b5f07a2a4..5dd38e04353355 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -1314,11 +1314,7 @@ int Http2Session::OnDataChunkReceived(nghttp2_session* handle, } else { memcpy(buf.base, data, avail); } - if (buf.base == nullptr) [[likely]] { - buf.base = reinterpret_cast(const_cast(data)); - } else { - memcpy(buf.base, data, avail); - } + data += avail; len -= avail; stream->EmitRead(avail, buf);