From e7a14c3a7c743502aedcdb00b297adc7842bf956 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Tue, 3 May 2016 13:19:48 +0200 Subject: [PATCH] candump: Ensure than controller ID is not out of range --- rpp-test-sw/commands/cmd_can.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rpp-test-sw/commands/cmd_can.c b/rpp-test-sw/commands/cmd_can.c index f5195e9..f98422b 100644 --- a/rpp-test-sw/commands/cmd_can.c +++ b/rpp-test-sw/commands/cmd_can.c @@ -737,6 +737,11 @@ int cmd_do_can_dump(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) return 1; } + if (controller_id < 1 || controller_id > 3) { + rpp_sci_printf("Invalid controller ID\n"); + return -CMDERR_NODEV; + } + rpp_can_init(&can_config); while (cmd_io->getc(cmd_io) < 0) { -- 2.39.2