Commit 72149711 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Botan: Fix potential null pointer access.



Change-Id: I0bc9ea383f74dc642b17001593313044a36abede
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent c91980ce
......@@ -40267,8 +40267,9 @@ EMSA2::EMSA2(HashFunction* hash_in) : hash(hash_in)
 
if(hash_id == 0)
{
const std::string hashName = hash->name();
delete hash;
throw Encoding_Error("EMSA2 cannot be used with " + hash->name());
throw Encoding_Error("EMSA2 cannot be used with " + hashName);
}
}
 
......@@ -44282,10 +44283,12 @@ Randpool::Randpool(BlockCipher* cipher_in,
!cipher->valid_keylength(OUTPUT_LENGTH) ||
!mac->valid_keylength(OUTPUT_LENGTH))
{
const std::string cipherName = cipher->name();
const std::string macName = mac->name();
delete cipher;
delete mac;
throw Internal_Error("Randpool: Invalid algorithm combination " +
cipher->name() + "/" + mac->name());
cipherName + "/" + macName);
}
 
buffer.resize(BLOCK_SIZE);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment