From 9399e12c217343545bf412a01629570377536b39 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 10 Aug 2021 12:42:11 +0200 Subject: rtems: Fix rtems_partition_return_buffer() The rtems_partition_return_buffer() wrongly accepted which were exactly at the buffer area end. Use the buffer area limit address for the range checking. Close #4490. --- cpukit/libmisc/monitor/mon-part.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cpukit/libmisc') diff --git a/cpukit/libmisc/monitor/mon-part.c b/cpukit/libmisc/monitor/mon-part.c index 18034cd58f..654700ebfc 100644 --- a/cpukit/libmisc/monitor/mon-part.c +++ b/cpukit/libmisc/monitor/mon-part.c @@ -22,8 +22,9 @@ rtems_monitor_part_canonical( const Partition_Control *rtems_part = (const Partition_Control *) part_void; canonical_part->attribute = rtems_part->attribute_set; - canonical_part->start_addr = rtems_part->starting_address; - canonical_part->length = rtems_part->length; + canonical_part->start_addr = rtems_part->base_address; + canonical_part->length = (uint32_t) ( (uintptr_t) + rtems_part->limit_address + 1 - (uintptr_t) rtems_part->base_address ); canonical_part->buf_size = rtems_part->buffer_size; canonical_part->used_blocks = rtems_part->number_of_used_blocks; } -- cgit v1.2.3