From 29a5f4da8dfe99cf595560c4b0c09bd4ade45316 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Mon, 17 Feb 2003 21:21:43 +0000 Subject: [PATCH] 2003-02-17 Marcel Telka * src/jtag.c (jtag_parse_line): Fixed segfault for 'set' command. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@366 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 4 ++++ jtag/src/jtag.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 64647463..365c5890 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,7 @@ +2003-02-17 Marcel Telka + + * src/jtag.c (jtag_parse_line): Fixed segfault for 'set' command. + 2003-02-17 Marcel Telka * src/jtag.c (jtag_parse_line): Added new 'get signal' command. diff --git a/jtag/src/jtag.c b/jtag/src/jtag.c index ee7ca882..637f7f14 100644 --- a/jtag/src/jtag.c +++ b/jtag/src/jtag.c @@ -637,6 +637,10 @@ jtag_parse_line( char *line ) dir = (strcmp( t, "in" ) == 0) ? 0 : 1; if (dir) { t = get_token( NULL ); + if (!t) { + printf( "set: syntax error\n" ); + return 1; + } data = strtol( t, &t, 10 ); if (t && *t) { printf( "set: syntax error\n" );