mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 17:31:46 -05:00
http2: Fix address sanitizer memcpy warning
- In Curl_http2_switched don't call memcpy when src is NULL. Curl_http2_switched can be called like: Curl_http2_switched(conn, NULL, 0); .. and prior to this change memcpy was then called like: memcpy(dest, NULL, 0) .. causing address sanitizer to warn: http2.c:2057:3: runtime error: null pointer passed as argument 2, which is declared to never be null
This commit is contained in:
parent
03d707fc5f
commit
b65f79d9e8
@ -2054,7 +2054,8 @@ CURLcode Curl_http2_switched(struct connectdata *conn,
|
|||||||
" after upgrade: len=%zu\n",
|
" after upgrade: len=%zu\n",
|
||||||
nread);
|
nread);
|
||||||
|
|
||||||
memcpy(httpc->inbuf, mem, nread);
|
if(nread)
|
||||||
|
memcpy(httpc->inbuf, mem, nread);
|
||||||
httpc->inbuflen = nread;
|
httpc->inbuflen = nread;
|
||||||
|
|
||||||
nproc = nghttp2_session_mem_recv(httpc->h2, (const uint8_t *)httpc->inbuf,
|
nproc = nghttp2_session_mem_recv(httpc->h2, (const uint8_t *)httpc->inbuf,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user