From 61adaae76be7be859491c14f2f82570c11b762a4 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 5 Jul 2022 00:07:55 -0500 Subject: Qt UI: Handle salt material correctly Found by Clang 13. We should have been doing it this way all along. --- ui/qt5/horizonwizard.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ui') diff --git a/ui/qt5/horizonwizard.cc b/ui/qt5/horizonwizard.cc index 7def8c8..7fefee5 100644 --- a/ui/qt5/horizonwizard.cc +++ b/ui/qt5/horizonwizard.cc @@ -384,10 +384,10 @@ char *encrypt_pw(const char *the_pw) { RAND_bytes(rawsalt, 8); QByteArray salt_ba(reinterpret_cast(rawsalt), 8); - const char *salt = ("$6$" + salt_ba.toBase64(QByteArray::OmitTrailingEquals) - .toStdString() + "$").c_str(); + std::string salt("$6$" + salt_ba.toBase64(QByteArray::OmitTrailingEquals) + .toStdString() + "$"); char *result = new char[128]; - if(do_a_crypt(the_pw, salt, result) == nullptr) { + if(do_a_crypt(the_pw, salt.c_str(), result) == nullptr) { delete[] result; return nullptr; } -- cgit v1.2.3-60-g2f50