From 078aa0acb63ca376ed98fc90934e714ccf5aaac4 Mon Sep 17 00:00:00 2001 From: Nav Date: Wed, 26 Apr 2023 19:36:15 +0100 Subject: [PATCH] Corrected stack pointer validation in TopLevelGroupItem --- .../HexViewerWidget/TopLevelGroupItem.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/TopLevelGroupItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/TopLevelGroupItem.cpp index 47d8e86f..f8b21cfc 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/TopLevelGroupItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/TopLevelGroupItem.cpp @@ -29,10 +29,8 @@ namespace Bloom::Widgets const auto& currentStackPointer = this->hexViewerState.currentStackPointer; const auto stackGroupingRequired = currentStackPointer.has_value() && this->hexViewerState.settings.groupStackMemory - && ( - static_cast(this->hexViewerState.memoryDescriptor.addressRange.endAddress) - - static_cast(*currentStackPointer + 1) - ) > 0; + && *currentStackPointer >= this->hexViewerState.memoryDescriptor.addressRange.startAddress + && (*currentStackPointer + 1) <= this->hexViewerState.memoryDescriptor.addressRange.endAddress; for (const auto& focusedRegion : this->focusedMemoryRegions) { if (