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 <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/516
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
__archive__
Mathias K 2012-03-13 16:40:22 +01:00 committed by Spencer Oliver
parent e26d076190
commit 0ba480d924
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}