Merge pull request #673 from cconlon/fortify

address fortify critical issues
This commit is contained in:
toddouska 2016-12-19 13:42:11 -08:00 committed by GitHub
commit dca57bf2f0
2 changed files with 11 additions and 1 deletions

View File

@ -10537,7 +10537,9 @@ int SendCertificate(WOLFSSL* ssl)
sendSz = BuildMessage(ssl, output, sendSz, input, inputSz,
handshake, 1, 0);
XFREE(input, ssl->heap, DYNAMIC_TYPE_TMP_BUFFER);
if (inputSz > 0)
XFREE(input, ssl->heap, DYNAMIC_TYPE_TMP_BUFFER);
if (sendSz < 0)
return sendSz;

View File

@ -1963,6 +1963,14 @@ int ToTraditionalEnc(byte* input, word32 sz,const char* password,int passwordSz)
return ASN_PARSE_E;
}
if (length > MAX_IV_SIZE) {
#ifdef WOLFSSL_SMALL_STACK
XFREE(salt, NULL, DYNAMIC_TYPE_TMP_BUFFER);
XFREE(cbcIv, NULL, DYNAMIC_TYPE_TMP_BUFFER);
#endif
return ASN_PARSE_E;
}
XMEMCPY(cbcIv, &input[inOutIdx], length);
inOutIdx += length;
}