There are two cases of UB that are fixed in this commit. 1. In ethercatmain.c, there are two left shifts of 31: (1 << 31) Because 1 is a signed int by default, the result cannot be represented in an int. The fix is to explicitly make the 1 unsigned. 2. In ethercatconfig.c, for slaves that have no inputs, the code would apply an offset to a NULL pointer. The fix is to test that the slave has inputs available before applying the offset. Both cases were found by clang with the help of UBSan.
Simple Open EtherCAT Master Library
BUILDING
Prerequisites for all platforms
- CMake 2.8.0 or later
Windows (Visual Studio)
- Start a Visual Studio command prompt then:
mkdir build
cd build
cmake .. -G "NMake Makefiles"
nmake
Linux & macOS
mkdir build
cd build
cmake ..
make
ERIKA Enterprise RTOS
Documentation
See https://openethercatsociety.github.io/doc/soem/
Want to contribute to SOEM or SOES?
If you want to contribute to SOEM or SOES you will need to sign a Contributor License Agreement and send it to us either by e-mail or by physical mail. More information is available in the PDF.
Description
Languages
C
99.3%
CMake
0.7%