From: Nikos Mavrogiannopoulos Date: Fri, 23 May 2014 16:47:52 +0000 (+0200) Subject: only try to copy session ID if there is a session ID. X-Git-Tag: gnutls_3_3_3~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1375d4e6d7bb969bf6c91ad78be41698073070f3;p=thirdparty%2Fgnutls.git only try to copy session ID if there is a session ID. --- diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c index 50a202c7c0..3316ff158a 100644 --- a/lib/gnutls_handshake.c +++ b/lib/gnutls_handshake.c @@ -1694,8 +1694,10 @@ client_check_if_resuming(gnutls_session_t session, session->internals.resumed = RESUME_FALSE; /* we are not resuming */ session->security_parameters.session_id_size = session_id_len; - memcpy(session->security_parameters.session_id, session_id, - session_id_len); + if (session_id_len > 0) { + memcpy(session->security_parameters.session_id, session_id, + session_id_len); + } return -1; }