From: OpenOCD-Gerrit <ope...@us...> - 2021-08-30 13:54:32
|
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 9a9e9e2c666dcb4987421f89d3b09ff9951cb0a1 (commit) from 70cd395f3f0b7f7974125ce6e728980e855626ea (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 9a9e9e2c666dcb4987421f89d3b09ff9951cb0a1 Author: Tarek BOCHKATI <tar...@gm...> Date: Wed Aug 18 19:55:48 2021 +0100 server/telnet: enhance telnet_move_cursor instrument the telnet_move_cursor to detect when there is no change of cursor position and if the requested new position is out of bounds. Change-Id: I24da877e538a458da6d2f8ddc2a681eee404d2cb Signed-off-by: Tarek BOCHKATI <tar...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6441 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c index f7b3f6449..36b017c58 100644 --- a/src/server/telnet_server.c +++ b/src/server/telnet_server.c @@ -352,10 +352,14 @@ static int telnet_history_print(struct connection *connection) static void telnet_move_cursor(struct connection *connection, size_t pos) { - struct telnet_connection *tc; + struct telnet_connection *tc = connection->priv; size_t tmp; - tc = connection->priv; + if (pos == tc->line_cursor) /* nothing to do */ + return; + + if (pos > tc->line_size) /* out of bounds */ + return; if (pos < tc->line_cursor) { tmp = tc->line_cursor - pos; ----------------------------------------------------------------------- Summary of changes: src/server/telnet_server.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |