diff --git a/cpu/esp32/esp-eth/esp_eth_netdev.c b/cpu/esp32/esp-eth/esp_eth_netdev.c index f3dd51cb86..32ddeaf045 100644 --- a/cpu/esp32/esp-eth/esp_eth_netdev.c +++ b/cpu/esp32/esp-eth/esp_eth_netdev.c @@ -200,8 +200,10 @@ static int _esp_eth_send(netdev_t *netdev, const iolist_t *iolist) mutex_unlock(&dev->dev_lock); return -EOVERFLOW; } - memcpy (dev->tx_buf + dev->tx_len, iol->iol_base, iol->iol_len); - dev->tx_len += iol->iol_len; + if (iol->iol_len) { + memcpy (dev->tx_buf + dev->tx_len, iol->iol_base, iol->iol_len); + dev->tx_len += iol->iol_len; + } } #if ENABLE_DEBUG