Add check for the hash response size during the processing

This commit is contained in:
Anthony Louis committed 2021-04-09 19:34:23 -03:00
1 parent 258c93d46f
commit 4afdc0fc78
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -43,7 +43,7 @@ namespace gandiva {
const void* message,
size_t message_length,
const EVP_MD *hash_type,
int result_buf_size,
uint32_t result_buf_size,
int32_t *out_length) {
EVP_MD_CTX *md_ctx = EVP_MD_CTX_new();
@@ -67,7 +67,7 @@ namespace gandiva {
}
// Create the temporary buffer used by the EVP to generate the hash
int hash_digest_size = EVP_MD_size(hash_type);
unsigned int hash_digest_size = EVP_MD_size(hash_type);
auto* result = static_cast<unsigned char*>(OPENSSL_malloc(hash_digest_size));
if (result == nullptr) {
+1 -1
View File
@@ -44,7 +44,7 @@ class GANDIVA_EXPORT HashUtils {
const void *message,
size_t message_length,
const EVP_MD *hash_type,
int result_buf_size,
uint32_t result_buf_size,
int32_t *out_length);
static void ErrorMessage(int64_t context_ptr, char const *err_msg);