From: Krzysztof Jackiewicz Date: Wed, 17 Apr 2024 12:25:09 +0000 (+0200) Subject: Fix issues reported by SVACE/Coverity X-Git-Tag: accepted/tizen/unified/20240423.164624~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b61ce1322375c52f7676173f1f80ddcf5a7a89b;p=platform%2Fcore%2Fsecurity%2Fwebauthn-ble.git Fix issues reported by SVACE/Coverity Change-Id: Ide8e99b306cc623f5c1a46ff5a0373f7484870c1 --- diff --git a/srcs/ctap_message_processor.h b/srcs/ctap_message_processor.h index 812f807..dcf0d84 100644 --- a/srcs/ctap_message_processor.h +++ b/srcs/ctap_message_processor.h @@ -47,7 +47,7 @@ public: // May be called from the other thread. virtual void Cancel() = 0; - ~ICtapMessageProcessor() = default; + virtual ~ICtapMessageProcessor() = default; }; class CtapMessageProcessor : public ICtapMessageProcessor { diff --git a/srcs/message.h b/srcs/message.h index 3e3ac7c..3fbba44 100644 --- a/srcs/message.h +++ b/srcs/message.h @@ -168,7 +168,7 @@ public: }; BufferView m_rpIdHash; - uint8_t m_flags; + uint8_t m_flags = 0; std::optional m_attestationData; } m_authData; diff --git a/tests/cbor_tests.cpp b/tests/cbor_tests.cpp index 77ad9ef..edb3b1a 100644 --- a/tests/cbor_tests.cpp +++ b/tests/cbor_tests.cpp @@ -266,7 +266,7 @@ TEST(CborEncoding, EmptyBuffers) ASSERT_NO_THROW(map.AppendByteStringAt(0x02, Buffer{})); wauthn_const_buffer_s buffer; buffer.data = nullptr; - buffer.data = 0; + buffer.size = 0; ASSERT_NO_THROW(map.AppendByteStringAt(0x03, buffer)); buffer.size = 10; ASSERT_THROW(map.AppendByteStringAt(0x04, buffer), Exception::InvalidParam); diff --git a/tests/man_tests.cpp b/tests/man_tests.cpp index 9599afd..d6dd6ae 100644 --- a/tests/man_tests.cpp +++ b/tests/man_tests.cpp @@ -138,7 +138,7 @@ void DisplayQRCallback(const char *qr_contents, void *data) if (testContents->path.empty() || !qr_contents) { std::cout << "qrcode_callback failed" << std::endl; std::cout << "QRcode path: " << testContents->path << std::endl; - std::cout << "qr_contents: " << qr_contents << std::endl; + std::cout << "qr_contents: " << (qr_contents ? qr_contents : "null") << std::endl; testContents->status = false; return; } @@ -347,7 +347,7 @@ int main(int argc, char *argv[]) ret = 1; } - if (system("killall /usr/apps/org.tizen.image-viewer_common/bin/image-viewer")) { + if (system("/usr/bin/killall /usr/apps/org.tizen.image-viewer_common/bin/image-viewer")) { std::cout << "Cannot close org.tizen.image-viewer\n"; ret = 1; } diff --git a/tests/tunnel/auto_tests.cpp b/tests/tunnel/auto_tests.cpp index a001e19..0d9889f 100644 --- a/tests/tunnel/auto_tests.cpp +++ b/tests/tunnel/auto_tests.cpp @@ -563,7 +563,7 @@ TEST(TunnelMockedTests, InjectedEvents) } private: - const std::vector *m_injectionsMap; + const std::vector *m_injectionsMap = nullptr; size_t m_injectionsMapNextEventIdx = 0; int m_eventNo = 0; };