1
0
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:
Will Cosgrove
2018-03-12 10:22:52 -07:00
committed by GitHub
parent f8b2474fb6
commit 228c3d9f48

View File

@@ -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 */