We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1f36b1c + da04cc3 commit 1bf9303Copy full SHA for 1bf9303
features/netsocket/emac-drivers/TARGET_STM/stm32xx_emac.cpp
100644
100755
@@ -520,7 +520,7 @@ bool STM32_EMAC::link_out(emac_mem_buf_t *buf)
520
int STM32_EMAC::low_level_input(emac_mem_buf_t **buf)
521
#ifndef ETH_IP_VERSION_V2
522
{
523
- uint16_t len = 0;
+ uint32_t len = 0;
524
uint8_t *buffer;
525
__IO ETH_DMADescTypeDef *dmarxdesc;
526
uint32_t bufferoffset = 0;
@@ -540,7 +540,7 @@ int STM32_EMAC::low_level_input(emac_mem_buf_t **buf)
540
541
dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc;
542
543
- if (len > 0) {
+ if (len > 0 && len <= ETH_RX_BUF_SIZE) {
544
/* Allocate a memory buffer chain from buffer pool */
545
*buf = memory_manager->alloc_pool(len, 0);
546
}
0 commit comments