From 4ac7ac5b595cb1710a63d4dc917e65e20baca7a1 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 10 Mar 2023 13:50:30 +0100 Subject: [PATCH] QCryptographicHash: fix missing EVP_DigestInit_ex() after EVP_MD_CTX_reset() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EVP_MD_CTX_reset() alone is not sufficient. A following EVP_DigestUpdate() crashes, so re-init the context, too. Amends 189444d8c4a1384479962e98e699bf1fd2908de8. Pick-to: 6.5 Change-Id: I5dede0adddd7f6b0c62540f6d45917b3236e3d02 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Qt CI Bot --- src/corelib/tools/qcryptographichash.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index ccf34312deb..258a97b8e18 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -550,6 +550,7 @@ void QCryptographicHashPrivate::reset() noexcept if (context && !initializationFailed) { // everything already set up - just reset the context EVP_MD_CTX_reset(context.get()); + initializationFailed = !EVP_DigestInit_ex(context.get(), algorithm.get(), nullptr); return; }