Commit c1f138c1 authored by Kurt Roeckx's avatar Kurt Roeckx
Browse files

Only call memcpy when the length is larger than 0.



Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
GH: #2050
(cherry picked from commit a19fc66a)
parent e01cee6d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1022,6 +1022,7 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt)
        s->session->ssl_version = s->version;
        s->session->session_id_length = session_id_len;
        /* session_id_len could be 0 */
        if (session_id_len > 0)
            memcpy(s->session->session_id, PACKET_data(&session_id),
                   session_id_len);
    }