From 3d04669ef00bfbed773d8f10061933db9ca531fc Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 12 Nov 2023 00:20:30 +0100 Subject: [PATCH] fix: Goto and Select being able to select bytes in zero-size files --- plugins/builtin/include/ui/hex_editor.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/builtin/include/ui/hex_editor.hpp b/plugins/builtin/include/ui/hex_editor.hpp index 36e810d5f..c28005e89 100644 --- a/plugins/builtin/include/ui/hex_editor.hpp +++ b/plugins/builtin/include/ui/hex_editor.hpp @@ -51,6 +51,9 @@ namespace hex::plugin::builtin::ui { if (start < this->m_provider->getBaseAddress()) return; + if (this->m_provider->getActualSize() == 0) + return; + const size_t maxAddress = this->m_provider->getActualSize() + this->m_provider->getBaseAddress() - 1; constexpr static auto alignDown = [](u128 value, u128 alignment) {