From c6529688fc6cd8b80cf0e2a6a4bca81d9cdc48c9 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 24 Oct 2018 00:00:12 -0400 Subject: [PATCH 1/2] key_manager: Remove unused variable in DeriveBase() --- src/core/crypto/key_manager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index fd0786068..fefc3c747 100644 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp @@ -713,7 +713,6 @@ void KeyManager::DeriveBase() { const auto sbk = GetKey(S128KeyType::SecureBoot); const auto tsec = GetKey(S128KeyType::TSEC); - const auto master_source = GetKey(S128KeyType::Source, static_cast(SourceKeyType::Master)); for (size_t i = 0; i < revisions.size(); ++i) { if (!revisions[i]) From c7c594a6b8416a68f40c7c141c58727e33c05b0a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 24 Oct 2018 00:01:29 -0400 Subject: [PATCH 2/2] vfs: Handle failure of file reading within VfsRawCopy() Also gets rid of an unused variable. --- src/core/file_sys/vfs.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/file_sys/vfs.cpp b/src/core/file_sys/vfs.cpp index bfe50da73..3824c74e0 100644 --- a/src/core/file_sys/vfs.cpp +++ b/src/core/file_sys/vfs.cpp @@ -472,10 +472,14 @@ bool VfsRawCopy(const VirtualFile& src, const VirtualFile& dest, std::size_t blo std::vector temp(std::min(block_size, src->GetSize())); for (std::size_t i = 0; i < src->GetSize(); i += block_size) { const auto read = std::min(block_size, src->GetSize() - i); - const auto block = src->Read(temp.data(), read, i); - if (dest->Write(temp.data(), read, i) != read) + if (src->Read(temp.data(), read, i) != read) { return false; + } + + if (dest->Write(temp.data(), read, i) != read) { + return false; + } } return true;