Commit 75c1a6f9 authored by Paul Bakker's avatar Paul Bakker
Browse files

Fixed potential heap buffer overflow on large hostname setting

parent 694d3aeb
......@@ -3220,6 +3220,10 @@ int ssl_set_hostname( ssl_context *ssl, const char *hostname )
return( POLARSSL_ERR_SSL_BAD_INPUT_DATA );
ssl->hostname_len = strlen( hostname );
if( ssl->hostname_len + 1 == 0 )
return( POLARSSL_ERR_SSL_BAD_INPUT_DATA );
ssl->hostname = (unsigned char *) polarssl_malloc( ssl->hostname_len + 1 );
if( ssl->hostname == NULL )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment