From 7214971199a4537981ae28fc62377c88b517218a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 18 Nov 2014 17:18:06 +0100 Subject: [PATCH] Botan: Fix potential null pointer access. Change-Id: I0bc9ea383f74dc642b17001593313044a36abede Reviewed-by: Tobias Hunger --- src/libs/3rdparty/botan/botan.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libs/3rdparty/botan/botan.cpp b/src/libs/3rdparty/botan/botan.cpp index 9715a56f6a1..0a859da7895 100644 --- a/src/libs/3rdparty/botan/botan.cpp +++ b/src/libs/3rdparty/botan/botan.cpp @@ -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);