From 206b1a1b57ced55d96ed4c6b6fb737ebf50c675c Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 9 Dec 2019 22:44:10 -0800 Subject: [PATCH] kvdb: correct condition inversion in kvdb::Archive --- libraries/libstratosphere/source/kvdb/kvdb_archive.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/libstratosphere/source/kvdb/kvdb_archive.cpp b/libraries/libstratosphere/source/kvdb/kvdb_archive.cpp index 40a4d055b..c1889a664 100644 --- a/libraries/libstratosphere/source/kvdb/kvdb_archive.cpp +++ b/libraries/libstratosphere/source/kvdb/kvdb_archive.cpp @@ -70,7 +70,7 @@ namespace ams::kvdb { Result ArchiveReader::Peek(void *dst, size_t size) { /* Bounds check. */ R_UNLESS(this->offset + size <= this->buffer.GetSize(), ResultInvalidKeyValue()); - R_UNLESS(this->offset + size <= this->offset, ResultInvalidKeyValue()); + R_UNLESS(this->offset < this->offset + size, ResultInvalidKeyValue()); std::memcpy(dst, this->buffer.Get() + this->offset, size); return ResultSuccess(); @@ -131,7 +131,7 @@ namespace ams::kvdb { Result ArchiveWriter::Write(const void *src, size_t size) { /* Bounds check. */ R_UNLESS(this->offset + size <= this->buffer.GetSize(), ResultInvalidKeyValue()); - R_UNLESS(this->offset + size <= this->offset, ResultInvalidKeyValue()); + R_UNLESS(this->offset < this->offset + size, ResultInvalidKeyValue()); std::memcpy(this->buffer.Get() + this->offset, src, size); this->offset += size;