Don't use memcpy() for 2-byte copy operation

Manual copying is slightly shorter here.
This commit is contained in:
Hanno Becker 2019-07-26 08:07:03 +01:00
parent 9eca276768
commit d0b66d08bb

View file

@ -5056,13 +5056,11 @@ static int ssl_parse_record_header( mbedtls_ssl_context const *ssl,
* Parse and validate record version * Parse and validate record version
*/ */
memcpy( &rec->ver[0], rec->ver[0] = buf[ rec_hdr_version_offset + 0 ];
buf + rec_hdr_version_offset, rec->ver[1] = buf[ rec_hdr_version_offset + 1 ];
rec_hdr_version_len );
mbedtls_ssl_read_version( &major_ver, &minor_ver, mbedtls_ssl_read_version( &major_ver, &minor_ver,
ssl->conf->transport, ssl->conf->transport,
buf + rec_hdr_version_offset ); &rec->ver[0] );
if( major_ver != ssl->major_ver ) if( major_ver != ssl->major_ver )
{ {