Merge pull request #96 from JacobBarthelmeh/fuzz

sanity checks on arguments
pull/99/head
John Safranek 2018-09-07 15:09:22 -07:00 committed by GitHub
commit de5b1fbab3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -2591,7 +2591,8 @@ static int DoKexDhGexRequest(WOLFSSH* ssh,
word32 begin;
int ret = WS_SUCCESS;
if (ssh == NULL || buf == NULL || len == 0 || idx == NULL)
if (ssh == NULL || ssh->handshake == NULL || buf == NULL || len == 0 ||
idx == NULL)
ret = WS_BAD_ARGUMENT;
if (ret == WS_SUCCESS) {
@ -5028,6 +5029,10 @@ int SendKexDhReply(WOLFSSH* ssh)
WLOG(WS_LOG_DEBUG, "Entering SendKexDhReply()");
if (ssh == NULL || ssh->handshake == NULL) {
return WS_BAD_ARGUMENT;
}
sigKeyBlock.useRsa = ssh->handshake->pubKeyId == ID_SSH_RSA;
sigKeyBlock.name = IdToName(ssh->handshake->pubKeyId);
sigKeyBlock.nameSz = (word32)strlen(sigKeyBlock.name);
@ -5665,7 +5670,7 @@ int SendKexDhGexRequest(WOLFSSH* ssh)
int ret = WS_SUCCESS;
WLOG(WS_LOG_DEBUG, "Entering SendKexDhGexRequest()");
if (ssh == NULL)
if (ssh == NULL || ssh->handshake == NULL)
ret = WS_BAD_ARGUMENT;
if (ret == WS_SUCCESS) {