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:
@@ -1928,7 +1928,13 @@ static int ecdh_sha2_nistp(LIBSSH2_SESSION *session, libssh2_curve_type type,
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int rc;
|
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) {
|
if(exchange_state->state == libssh2_NB_state_idle) {
|
||||||
|
|
||||||
/* Setup initial values */
|
/* Setup initial values */
|
||||||
|
|||||||
Reference in New Issue
Block a user