canlab-cz / triple

Linux SocketCAN driver for USB2CAN Triple from Canlab s.r.o.

Home Page:http://www.rs.canlab.cz/?q=cs/node/123

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tripled_64 is crashing when setting user defined bittiming

martin-vitek opened this issue · comments

tripled_64 is crashing when setting user defined bittiming.

sudo ./tripled_64 ttyACM0 -s0x09:0x0A:0x21 -c10:6:1:1:10:6:1:1:0:0:2 -ncan0:can1:canfd2
Neoprávněný přístup do paměti (SIGSEGV)

With debugging prints:

sudo ./tripled_64 ttyACM0 -s0x09:0x0A:0x21 -c10:6:1:1:10:6:1:1:0:0:0 -ncan0:can1:canfd2
str=10, num=10
str=6, num=6
str=1, num=1
str=1, num=1
Neoprávněný přístup do paměti (SIGSEGV)

First problem is, that user_speed should have 11 items, not only 10:

unsigned int user_speed[10];

Second problem is with tmp, which should also have 11 items:

char *tmp[3];

Both are used in this loop:

triple/utility/main.c

Lines 166 to 167 in 4aa706b

for (i = 0; i < 11; i++)
user_speed[i] = strtoul(tmp[i], NULL, 10);

Lots of parameters.... I've not tested used user-defined settings, so I'll look into it.

Closing