Ensure that ecx_EOEsend is called with a valid slave to prevent memory
corruption. This check addresses potential issues when mistakenly
invoked on devices like the EK1100 EtherCAT coupler.
Change-Id: I82ceff6c3f22c69a1531e27a30586bd6f20afe44
txframeoffset = 0;
NotLast = TRUE;
+ /* Sanity check size of slave mailbox */
+ if (maxdata < 0)
+ {
+ /* This slave does not have a suitable mailbox */
+ EC_PRINT("EoE: Bad mailbox size\n");
+ return -1;
+ }
+
do
{
MbxOut = ecx_getmbx(context);