提交 a19fc66a 编写于 作者: K Kurt Roeckx

Only call memcpy when the length is larger than 0.

Reviewed-by: NRich Salz <rsalz@openssl.org>
GH: #2050
上级 120fb9e4
...@@ -1186,8 +1186,9 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt) ...@@ -1186,8 +1186,9 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt)
s->session->ssl_version = s->version; s->session->ssl_version = s->version;
s->session->session_id_length = session_id_len; s->session->session_id_length = session_id_len;
/* session_id_len could be 0 */ /* session_id_len could be 0 */
memcpy(s->session->session_id, PACKET_data(&session_id), if (session_id_len > 0)
session_id_len); memcpy(s->session->session_id, PACKET_data(&session_id),
session_id_len);
} }
/* Session version and negotiated protocol version should match */ /* Session version and negotiated protocol version should match */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册