Commit 67dbe1ef authored by Manuel Pégourié-Gonnard's avatar Manuel Pégourié-Gonnard
Browse files

Better length checking in ecp_point_read_binary()

parent 4e3e7c29
......@@ -492,6 +492,9 @@ int ecp_point_read_binary( const ecp_group *grp, ecp_point *pt,
int ret;
size_t plen;
if ( ilen < 1 )
return( POLARSSL_ERR_ECP_BAD_INPUT_DATA );
if( buf[0] == 0x00 )
{
if( ilen == 1 )
......@@ -529,7 +532,7 @@ int ecp_tls_read_point( const ecp_group *grp, ecp_point *pt,
const unsigned char *buf_start;
/*
* We must have at least two bytes (1 for length, at least of for data)
* We must have at least two bytes (1 for length, at least one for data)
*/
if( buf_len < 2 )
return( POLARSSL_ERR_ECP_BAD_INPUT_DATA );
......
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