From 1cf359def74d2f9842698a6ad5f419727b2944a0 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Wed, 11 Jan 2023 12:19:18 +0100 Subject: [PATCH] QCryptographicHash[OpenSSL]: do not resize result when adding data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is unnecessary and basically doesn't have any effect. Change-Id: I6b63e989c43bdcd55bf83d2c0756da2de1ab49df Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit a647d18df22d3aa8bfa3f4c1dbb1340095f0d200) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/tools/qcryptographichash.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 8210b7716b6..99a1149a521 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -616,7 +616,6 @@ void QCryptographicHashPrivate::addData(QByteArrayView bytes) noexcept method == QCryptographicHash::Blake2s_224) { blake2s_update(&blake2sContext, reinterpret_cast(data), length); } else if (!initializationFailed) { - result.resizeForOverwrite(EVP_MD_get_size(algorithm.get())); const int ret = EVP_DigestUpdate(context.get(), (const unsigned char *)data, length); Q_UNUSED(ret); }