From: Øyvind H. <go...@us...> - 2010-07-07 17:36:03
|
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 daa02f7d84017f21c3ffa2be9997560d353a8829 (commit) via ccaa9edf295e2c763c5a3c32a3f901b1637b99c5 (commit) from 3099858c68fd3a5f9960daea429198c0fc5a0f10 (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 daa02f7d84017f21c3ffa2be9997560d353a8829 Author: Ãyvind Harboe <oyv...@zy...> Date: Wed Jul 7 14:56:56 2010 +0200 transport: fix segfault in transport select String compare against addresses in range 0 or so due to not checking if there was an active session first. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/jtag/transport.c b/src/jtag/transport.c index cee8ffb..e431fee 100644 --- a/src/jtag/transport.c +++ b/src/jtag/transport.c @@ -281,18 +281,17 @@ COMMAND_HANDLER(handle_transport_select) return ERROR_FAIL; case 1: /* "select FOO" */ - if(strcmp(session->name, CMD_ARGV[0]) == 0) { + if ((session!= NULL) && strcmp(session->name, CMD_ARGV[0]) == 0) { /* NOP */ LOG_DEBUG("transport '%s' is already selected", CMD_ARGV[0]); return ERROR_OK; } else { - - /* we can't change this session's transport after-the-fact */ - if (session) { - LOG_ERROR("session's transport is already selected."); - return ERROR_FAIL; - } + /* we can't change this session's transport after-the-fact */ + if (session) { + LOG_ERROR("session's transport is already selected."); + return ERROR_FAIL; + } } break; commit ccaa9edf295e2c763c5a3c32a3f901b1637b99c5 Author: Ãyvind Harboe <oyv...@zy...> Date: Wed Jul 7 14:31:07 2010 +0200 transport: fix bug/typo in interface_transports command Classic manifestation of weakness of dangling { formatting :-) Hard to spot these sort of mistakes visually. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/jtag/adapter.c b/src/jtag/adapter.c index 15b3ddc..37e6ee9 100644 --- a/src/jtag/adapter.c +++ b/src/jtag/adapter.c @@ -101,14 +101,15 @@ COMMAND_HANDLER(interface_transport_command) retval = CALL_COMMAND_HANDLER(transport_list_parse, &transports); if (retval != ERROR_OK) { return retval; + } retval = allow_transports(CMD_CTX, (const char **)transports); + if (retval != ERROR_OK) { for (unsigned i = 0; transports[i]; i++) free(transports[i]); free(transports); } - } return retval; } ----------------------------------------------------------------------- Summary of changes: src/jtag/adapter.c | 3 ++- src/jtag/transport.c | 13 ++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) hooks/post-receive -- Main OpenOCD repository |