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 64b10f4 + 38f9a09 commit 757f14bCopy full SHA for 757f14b
features/netsocket/emac-drivers/TARGET_STM/stm32xx_emac.cpp
100644
100755
@@ -526,7 +526,7 @@ bool STM32_EMAC::link_out(emac_mem_buf_t *buf)
526
int STM32_EMAC::low_level_input(emac_mem_buf_t **buf)
527
#ifndef ETH_IP_VERSION_V2
528
{
529
- uint16_t len = 0;
+ uint32_t len = 0;
530
uint8_t *buffer;
531
__IO ETH_DMADescTypeDef *dmarxdesc;
532
uint32_t bufferoffset = 0;
@@ -546,7 +546,7 @@ int STM32_EMAC::low_level_input(emac_mem_buf_t **buf)
546
547
dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc;
548
549
- if (len > 0) {
+ if (len > 0 && len <= ETH_RX_BUF_SIZE) {
550
/* Allocate a memory buffer chain from buffer pool */
551
*buf = memory_manager->alloc_pool(len, 0);
552
}
0 commit comments