From: openocd-gerrit <ope...@us...> - 2025-03-09 03:13:50
|
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 7ec11e52387390ea1fab510f10fc6cd0ed200ef5 (commit) from 953ad9e11658534ea4ca682c7f112db3059be1cc (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 7ec11e52387390ea1fab510f10fc6cd0ed200ef5 Author: Evgeniy Naydanov <evg...@sy...> Date: Fri Feb 14 19:29:08 2025 +0300 rtos/rtos: handle OOM in `rtos_thread_packet()` Return an error in case `calloc()` fails. Change-Id: Ibb21a62991be83be8b219887953ccf27156f8af5 Signed-off-by: Evgeniy Naydanov <evg...@sy...> Reviewed-on: https://review.openocd.org/c/openocd/+/8763 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index f218f6369..2c563d522 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -362,6 +362,10 @@ int rtos_thread_packet(struct connection *connection, char const *packet, int pa str_size += strlen(detail->extra_info_str); char *tmp_str = calloc(str_size + 9, sizeof(char)); + if (!tmp_str) { + LOG_ERROR("Out of memory"); + return ERROR_FAIL; + } char *tmp_str_ptr = tmp_str; if (detail->thread_name_str) ----------------------------------------------------------------------- Summary of changes: src/rtos/rtos.c | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- Main OpenOCD repository |