projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
120fb9e
)
Only call memcpy when the length is larger than 0.
author
Kurt Roeckx
<kurt@roeckx.be>
Thu, 8 Dec 2016 18:20:55 +0000
(19:20 +0100)
committer
Kurt Roeckx
<kurt@roeckx.be>
Thu, 8 Dec 2016 19:17:01 +0000
(20:17 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
GH: #2050
ssl/statem/statem_clnt.c
patch
|
blob
|
history
diff --git
a/ssl/statem/statem_clnt.c
b/ssl/statem/statem_clnt.c
index 35ca8defa90d6b11309e861f61edd7d4850c4cfb..9b9d6cd6c746d4706e0f20e2f95d731c352f121b 100644
(file)
--- a/
ssl/statem/statem_clnt.c
+++ b/
ssl/statem/statem_clnt.c
@@
-1186,8
+1186,9
@@
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 */
- memcpy(s->session->session_id, PACKET_data(&session_id),
- session_id_len);
+ if (session_id_len > 0)
+ memcpy(s->session->session_id, PACKET_data(&session_id),
+ session_id_len);
}
/* Session version and negotiated protocol version should match */