From 6fb0f78c1af1ea1393b05e3751a2d2f941f8d000 Mon Sep 17 00:00:00 2001 From: Kolja Waschk Date: Sat, 19 Apr 2008 10:06:24 +0000 Subject: [PATCH] Fix [ 1933736 ] "frequency" command segfaults without args git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1172 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 5 +++++ jtag/src/cmd/frequency.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index d655f935..f0ac4d49 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,8 @@ +2008-04-19 Kolja Waschk + + * src/cmd/frequency.c: ensure that cable is initialized. Fixes + [ 1933736 ] "frequency" command segfaults without args + 2008-04-19 Arnim Laeuger * src/bsdl/Makefile.am, src/svf/Makefile.am: ensure that diff --git a/jtag/src/cmd/frequency.c b/jtag/src/cmd/frequency.c index 23e9d7ee..e0a857c5 100644 --- a/jtag/src/cmd/frequency.c +++ b/jtag/src/cmd/frequency.c @@ -36,6 +36,9 @@ cmd_frequency_run( chain_t *chain, char *params[] ) { unsigned int freq; + if (!cmd_test_cable( chain )) + return 1; + if (cmd_params( params ) == 1) { printf( _("Current TCK frequency is %u Hz\n"), cable_get_frequency(chain->cable) ); return 1;