From 58a6c1f1f53725d7b7b46ee0ad735a5d9fe45c4d Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Tue, 28 Apr 2026 11:06:42 +0300 Subject: [PATCH] Coverity fixes IB-8899 Signed-off-by: Raul Metsma --- client/CDocSupport.cpp | 10 +++++----- client/libcdoc | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/CDocSupport.cpp b/client/CDocSupport.cpp index 47a4419d1..379baa6f3 100644 --- a/client/CDocSupport.cpp +++ b/client/CDocSupport.cpp @@ -112,7 +112,7 @@ getDecryptStatus(const std::vector& result, QCryptoBackend::PinStatus p libcdoc::result_t DDCryptoBackend::decryptRSA(std::vector& result, const std::vector &data, bool oaep, unsigned int idx) { - QCryptoBackend::PinStatus pin_status; + QCryptoBackend::PinStatus pin_status = QCryptoBackend::PinOK; QByteArray qkek = qApp->signer()->decrypt([qdata = toByteArray(data), &oaep](QCryptoBackend *backend) { return backend->decrypt(qdata, oaep); }, pin_status); @@ -124,7 +124,7 @@ libcdoc::result_t DDCryptoBackend::deriveConcatKDF(std::vector& dst, const std::vector &publicKey, const std::string &digest, const std::vector &algorithmID, const std::vector &partyUInfo, const std::vector &partyVInfo, unsigned int idx) { - QCryptoBackend::PinStatus pin_status; + QCryptoBackend::PinStatus pin_status = QCryptoBackend::PinOK; QByteArray decryptedKey = qApp->signer()->decrypt([&publicKey, &digest, &algorithmID, &partyUInfo, &partyVInfo](QCryptoBackend *backend) { static const QHash SHA_MTH{ {"http://www.w3.org/2001/04/xmlenc#sha256", QCryptographicHash::Sha256}, @@ -141,7 +141,7 @@ DDCryptoBackend::deriveConcatKDF(std::vector& dst, const std::vector& dst, const std::vector &key_material, const std::vector &salt, unsigned int idx) { - QCryptoBackend::PinStatus pin_status; + QCryptoBackend::PinStatus pin_status = QCryptoBackend::PinOK; QByteArray qkekpm = qApp->signer()->decrypt([qkey_material = toByteArray(key_material), qsalt = toByteArray(salt)](QCryptoBackend *backend) { return backend->deriveHMACExtract(qkey_material, qsalt, ECC_KEY_LEN); }, pin_status); @@ -290,7 +290,7 @@ DDNetworkBackend::fetchKey(std::vector &result, last_error = "No connection"; return BACKEND_ERROR; } - QCryptoBackend::PinStatus pin_status; + QCryptoBackend::PinStatus pin_status = QCryptoBackend::PinOK; auto authKey = dispatchToMain([&] { return qApp->signer()->key(pin_status); }); @@ -412,7 +412,7 @@ TempListConsumer::open(const std::string& name, int64_t size) std::string truncated = name; if (truncated.starts_with("./PaxHeaders.X/")) truncated = truncated.substr(15); - IOEntry io({truncated, "application/octet-stream", 0, {}}); + IOEntry io({std::move(truncated), "application/octet-stream", 0, {}}); if ((size < 0) || (size > MAX_VEC_SIZE)) { io.data = std::make_unique(); } else { diff --git a/client/libcdoc b/client/libcdoc index f207eb5ec..7874b01bc 160000 --- a/client/libcdoc +++ b/client/libcdoc @@ -1 +1 @@ -Subproject commit f207eb5ecc9289eef8be78692a29d680d998cd04 +Subproject commit 7874b01bc3c9c8732428e67385fe18f814d09a28