|
From: openocd-gerrit <ope...@us...> - 2026-05-30 18:14:13
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via fcfbbe98b2280ddd78da5cca207a8674adf11e85 (commit)
from 56d91e42e30585358a03e9f31c0a9f4253fb3f3c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fcfbbe98b2280ddd78da5cca207a8674adf11e85
Author: Marc Schink <de...@za...>
Date: Sun May 10 12:20:14 2026 +0000
rtt: Fix reading inactive channels
The current implementation reads the names of inactive channels, which
can result in invalid data reads, memory access violations, and broken
output, for example:
> rtt channellist
[riscv.cpu] Failed to read memory (addr=0x0)
{
{
name Terminal
size 0x400
flags 0x0
}
Skip reading the names of inactive channels to avoid invalid memory
reads and broken output.
Change-Id: Iccc029c9ea1787eb361e4fba8119398abf5dafe1
Signed-off-by: Marc Schink <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9652
Reviewed-by: Antonio Borneo <bor...@gm...>
Reviewed-by: Chris Head <ch...@za...>
Tested-by: jenkins
diff --git a/src/target/rtt.c b/src/target/rtt.c
index 5b7fdda40..0dd82f5c7 100644
--- a/src/target/rtt.c
+++ b/src/target/rtt.c
@@ -339,15 +339,18 @@ int target_rtt_read_channel_info(struct target *target,
return ret;
}
+ info->size = channel.size;
+ info->flags = channel.flags;
+
+ if (!channel_is_active(&channel))
+ return ERROR_OK;
+
ret = read_channel_name(target, channel.name_addr, info->name,
info->name_length);
if (ret != ERROR_OK)
return ret;
- info->size = channel.size;
- info->flags = channel.flags;
-
return ERROR_OK;
}
-----------------------------------------------------------------------
Summary of changes:
src/target/rtt.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|