@ -810,6 +810,7 @@ EXT_RETURN tls_construct_ctos_early_data(SSL *s, WPACKET *pkt,
OPENSSL_free ( s - > psksession_id ) ;
s - > psksession_id = OPENSSL_memdup ( id , idlen ) ;
if ( s - > psksession_id = = NULL ) {
s - > psksession_id_len = 0 ;
SSLfatal ( s , SSL_AD_INTERNAL_ERROR , ERR_R_INTERNAL_ERROR ) ;
return EXT_RETURN_FAIL ;
}
@ -1337,6 +1338,7 @@ int tls_parse_stoc_ec_pt_formats(SSL *s, PACKET *pkt, unsigned int context,
OPENSSL_free ( s - > ext . peer_ecpointformats ) ;
s - > ext . peer_ecpointformats = OPENSSL_malloc ( ecpointformats_len ) ;
if ( s - > ext . peer_ecpointformats = = NULL ) {
s - > ext . peer_ecpointformats_len = 0 ;
SSLfatal ( s , SSL_AD_INTERNAL_ERROR , ERR_R_INTERNAL_ERROR ) ;
return 0 ;
}
@ -1446,8 +1448,12 @@ int tls_parse_stoc_sct(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
s - > ext . scts_len = ( uint16_t ) size ;
if ( size > 0 ) {
s - > ext . scts = OPENSSL_malloc ( size ) ;
if ( s - > ext . scts = = NULL
| | ! PACKET_copy_bytes ( pkt , s - > ext . scts , size ) ) {
if ( s - > ext . scts = = NULL ) {
s - > ext . scts_len = 0 ;
SSLfatal ( s , SSL_AD_INTERNAL_ERROR , ERR_R_MALLOC_FAILURE ) ;
return 0 ;
}
if ( ! PACKET_copy_bytes ( pkt , s - > ext . scts , size ) ) {
SSLfatal ( s , SSL_AD_INTERNAL_ERROR , ERR_R_INTERNAL_ERROR ) ;
return 0 ;
}
@ -1541,6 +1547,7 @@ int tls_parse_stoc_npn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
OPENSSL_free ( s - > ext . npn ) ;
s - > ext . npn = OPENSSL_malloc ( selected_len ) ;
if ( s - > ext . npn = = NULL ) {
s - > ext . npn_len = 0 ;
SSLfatal ( s , SSL_AD_INTERNAL_ERROR , ERR_R_INTERNAL_ERROR ) ;
return 0 ;
}
@ -1578,6 +1585,7 @@ int tls_parse_stoc_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
OPENSSL_free ( s - > s3 . alpn_selected ) ;
s - > s3 . alpn_selected = OPENSSL_malloc ( len ) ;
if ( s - > s3 . alpn_selected = = NULL ) {
s - > s3 . alpn_selected_len = 0 ;
SSLfatal ( s , SSL_AD_INTERNAL_ERROR , ERR_R_INTERNAL_ERROR ) ;
return 0 ;
}
@ -1606,6 +1614,7 @@ int tls_parse_stoc_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
s - > session - > ext . alpn_selected =
OPENSSL_memdup ( s - > s3 . alpn_selected , s - > s3 . alpn_selected_len ) ;
if ( s - > session - > ext . alpn_selected = = NULL ) {
s - > session - > ext . alpn_selected_len = 0 ;
SSLfatal ( s , SSL_AD_INTERNAL_ERROR , ERR_R_INTERNAL_ERROR ) ;
return 0 ;
}