From d32452d90c9925d293e1566b684caeb4bc20a3f3 Mon Sep 17 00:00:00 2001 From: Joanna Hulboj Date: Wed, 14 Dec 2022 19:57:41 +0000 Subject: [PATCH] Fixed use-after-free of BLAKE3 error message As std::string is not POD there sadly was no warning from the compiler. --- src/Functions/FunctionsHashing.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Functions/FunctionsHashing.h b/src/Functions/FunctionsHashing.h index ee5f3ea86b5..2d1f0ea0c39 100644 --- a/src/Functions/FunctionsHashing.h +++ b/src/Functions/FunctionsHashing.h @@ -668,7 +668,7 @@ struct ImplBLAKE3 { auto err_st = std::string(err_msg); blake3_free_char_pointer(err_msg); - throw Exception("Function returned error message: " + std::string(err_msg), ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + throw Exception("Function returned error message: " + err_st, ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } } #endif