From 0ba480d9242ea21685c7fcfc4c09a2f473c3400b Mon Sep 17 00:00:00 2001 From: Mathias K Date: Tue, 13 Mar 2012 16:40:22 +0100 Subject: [PATCH] gdb_server: Fix wrong index/length compare. This patch fix the compare for the list size and the register index. Change-Id: I36d5e078f57d2a9f7823cfdf0d537762e00f6929 Signed-off-by: Mathias K Reviewed-on: http://openocd.zylin.com/516 Tested-by: jenkins Reviewed-by: Spencer Oliver --- src/server/gdb_server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 332f74a2..9ccc07cc 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1123,7 +1123,7 @@ static int gdb_set_register_packet(struct connection *connection, if (retval != ERROR_OK) return gdb_error(connection, retval); - if (reg_list_size < reg_num) { + if (reg_list_size <= reg_num) { LOG_ERROR("gdb requested a non-existing register"); return ERROR_SERVER_REMOTE_CLOSED; } -- 2.39.5