mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-21 14:00:51 +03:00
Added basic bounds checking #206
Basic bounds checking in ecdh_sha2_nistp()
This commit is contained in:
@@ -1929,6 +1929,12 @@ static int ecdh_sha2_nistp(LIBSSH2_SESSION *session, libssh2_curve_type type,
|
||||
int ret = 0;
|
||||
int rc;
|
||||
|
||||
if(data_len < 5){
|
||||
ret = _libssh2_error(session, LIBSSH2_ERROR_HOSTKEY_INIT,
|
||||
"Host key data is too short");
|
||||
return ret;
|
||||
}
|
||||
|
||||
if(exchange_state->state == libssh2_NB_state_idle) {
|
||||
|
||||
/* Setup initial values */
|
||||
|
||||
Reference in New Issue
Block a user