Hi all,
in file /master/master.c, function ecrt_master_get_slave you can find the
code
>> slave = ec_master_find_slave_const(master, 0, slave_position);
>>
>> slave_info->position = slave->ring_position;
(V1.5.1 about line 2300, V1.5.2 line 2632) If you follow
ec_master_find_slave_const you will see: this function may return NULL in
case slave_position is not valid / used, the next line will cause a
segmentation fault.
ectr.h tells us, that only the pointers have to be valid variables. I
suggest to add the following lines (V1.5.1):
>> slave = ec_master_find_slave_const(master, 0, slave_position);
>> if(slave==NULL)
>> {
>> up(&master->master_sem);
>> return -666; // or whatever errorcode.
>> }
>>
>> slave_info->position = slave->ring_position;
Olaf
_______________________________________________
etherlab-users mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-users