summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2022-07-05 00:07:55 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2022-07-05 00:07:55 -0500
commit61adaae76be7be859491c14f2f82570c11b762a4 (patch)
treee44e2cdb7cadb445f1fff158d8a23e4721c2c792
parentc1a91704745f4243809f82478ab943cb9f9d005f (diff)
downloadhorizon-61adaae76be7be859491c14f2f82570c11b762a4.tar.gz
horizon-61adaae76be7be859491c14f2f82570c11b762a4.tar.bz2
horizon-61adaae76be7be859491c14f2f82570c11b762a4.tar.xz
horizon-61adaae76be7be859491c14f2f82570c11b762a4.zip
Qt UI: Handle salt material correctly
Found by Clang 13. We should have been doing it this way all along.
-rw-r--r--ui/qt5/horizonwizard.cc6
1 files changed, 3 insertions, 3 deletions
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<char *>(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;
}