From: Mathias K Date: Tue, 13 Mar 2012 15:40:22 +0000 (+0100) Subject: gdb_server: Fix wrong index/length compare. X-Git-Tag: v0.6.0-rc1~180 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0ba480d9242ea21685c7fcfc4c09a2f473c3400b;p=openocd 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 --- 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; }