12 Commits
Author SHA1 Message Date
Hans-Erik Floryd 2ec034633b fix: remove unnecessary call to strcat
The strcat call is no longer needed after commit 0c291d4f9 which
refactored the output.

Change-Id: I580295a9eed63bb3656e32e1033c153187a58251
2026-02-26 12:02:49 +01:00
Hans-Erik Floryd 5c27e20332 fix: replace sprintf with snprintf
Replace unsafe sprintf() calls with snprintf() to prevent buffer
overflow vulnerabilities. This adds bounds checking to ensure we don't
write beyond allocated buffer space.

Change-Id: Ia5576dd85bfc8762c7fe01f22f38156078ac34cd
2026-02-26 12:02:49 +01:00
Hans-Erik Floryd bb63f23ea7 fix: replace strcpy with strncpy
Replace all instances of strcpy() with strncpy() to prevent buffer
overflow vulnerabilities. The strcpy() function does not perform
bounds checking, which can lead to security issues when copying
strings of unknown or excessive length.

Problem reported and fix suggested by Jaeyeong Lee.

Change-Id: Ide896dbae3bdaf9001287b4d3e387efd355e73bd
2026-02-26 12:02:49 +01:00
Hans-Erik Floryd 0093291cfa Update sample headers
Use same header for all sources.

Change-Id: Ie30f55f8fe64e6815482dd2662372e54791e833e
2025-07-11 11:28:30 +02:00
Hans-Erik Floryd 5827f10baa Inline ecx_contextt
Simplify user applications by allocating space for exc_contextt
members in the struct directly.

Change-Id: If53062539e265326c420020188621887435681f3
2025-07-10 11:38:59 +02:00
Hans-Erik Floryd 0c291d4f92 Fix buffer overflow in slaveinfo
The string buffer in SDO2string could overflow for large octet
strings. Fix by limiting output to the size of the output string.

Change-Id: Ic45056918570d8320a02f70a8795b6b863a590ff
2025-07-10 11:38:59 +02:00
Hans-Erik Floryd 3377d1d8ae Remove ecx_config_init usetable argument
The usetable argument was a leftover from the legacy API which was
removed in a previous commit.

Change-Id: I2fe5fdf9ed2e2c0b118dff43bf5d50b5809adbd7
2025-07-10 11:38:42 +02:00
Hans-Erik Floryd 3188367ef6 Add overlap and align modes to context
Simplify the API by adding overlap and byte alignment modes to the
context. SOEM can then call the correct functions internally. As a
consequence the following functions are removed from the public API:

   ecx_config_overlap_map_group
   ecx_config_map_group_aligned
   ecx_send_overlap_processdata_group
   ecx_send_overlap_processdata

Change-Id: I0404c4fbaa6be68be4c584af0cc9d62e780c7aaa
2025-07-10 11:38:42 +02:00
Hans-Erik Floryd 08064ae3fa Add more samples
Change-Id: I6bf219887efd88a69a257815f1974759d56fd3c3
2025-07-09 17:21:26 +02:00
Hans-Erik Floryd 0ae3d2f056 Run clang-format on sources
Change-Id: Ide59897b87104bfb71e953b7f8dace00e441e245
2025-07-09 17:20:48 +02:00
Hans-Erik Floryd 9582886c2c Refactor repository layout (step 2 of 2)
Rename files ethercat to ec_

Change-Id: If79f133fa37147bf509a3a75b0f4e14de860fea3
2025-07-09 17:20:48 +02:00
Hans-Erik Floryd 78b757b2bf Refactor repository layout (step 1 of 2)
Create include,src and test folders and move files accordingly.

Change-Id: I3caf7a8de2ba1a9ad5a9cedbaad3942657a3753d
2025-07-09 17:20:48 +02:00