fix: Fix NULL dereference in ecx_mbxreceive when mailbox pool is empty

Fix segfault in ecx_mbxreceive on exhausted mailbox pool (Issue#948)
This commit is contained in:
Eksan0325
2026-06-12 13:47:28 +02:00
committed by GitHub
parent b410bf6ef5
commit 7a8011bb28
+6 -1
View File
@@ -1671,7 +1671,12 @@ int ecx_mbxreceive(ecx_contextt *context, uint16 slave, ec_mbxbuft **mbx, int ti
if ((wkc > 0) && ((SMstat & 0x08) > 0)) /* read mailbox available ? */
{
mbxro = slavelist->mbx_ro;
mbxin = ecx_getmbx(context);
mbxin = ecx_getmbx(context);
if (mbxin == NULL)
{
*mbx = NULL;
return 0;
}
mbxh = (ec_mbxheadert *)mbxin;
do
{