Don't pass NULL to memcpy

This commit is contained in:
Tatsuhiro Tsujikawa 2016-02-12 22:31:47 +09:00
parent 5ad753b90c
commit 61dda40b44
1 changed files with 5 additions and 3 deletions

View File

@ -5640,10 +5640,12 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in,
readlen = inbound_frame_payload_readlen(iframe, in, last);
iframe->lbuf.last = nghttp2_cpymem(iframe->lbuf.last, in, readlen);
if (readlen > 0) {
iframe->lbuf.last = nghttp2_cpymem(iframe->lbuf.last, in, readlen);
iframe->payloadleft -= readlen;
in += readlen;
iframe->payloadleft -= readlen;
in += readlen;
}
DEBUGF(fprintf(stderr, "recv: readlen=%zu, payloadleft=%zu\n", readlen,
iframe->payloadleft));