Commit a19fc66a 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
parent 120fb9e4
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1186,6 +1186,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);
    }