target: Fix segfault for 'mem2array'
Call 'mem2array' without arguments to reproduce the segmentation fault. Change-Id: I02bf46cc8bd317abbb721a8c75d7cbfac99eb34e Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4534 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Christopher Head <chead@zaber.com>
This commit is contained in:
parent
d293583e03
commit
abc270c883
|
@ -4131,8 +4131,9 @@ static int target_mem2array(Jim_Interp *interp, struct target *target, int argc,
|
|||
* argv[3] = memory address
|
||||
* argv[4] = count of times to read
|
||||
*/
|
||||
|
||||
if (argc < 4 || argc > 5) {
|
||||
Jim_WrongNumArgs(interp, 1, argv, "varname width addr nelems [phys]");
|
||||
Jim_WrongNumArgs(interp, 0, argv, "varname width addr nelems [phys]");
|
||||
return JIM_ERR;
|
||||
}
|
||||
varname = Jim_GetString(argv[0], &len);
|
||||
|
|
Loading…
Reference in New Issue