From 150604aa4983f20a200b9f16f5738fd0017368f3 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sun, 24 Nov 2019 16:52:02 +0100 Subject: typo in _tr_release --- code/ecp/fe310/transport.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'code/ecp/fe310/transport.c') diff --git a/code/ecp/fe310/transport.c b/code/ecp/fe310/transport.c index a0b4a05..6da5139 100644 --- a/code/ecp/fe310/transport.c +++ b/code/ecp/fe310/transport.c @@ -26,6 +26,11 @@ static void packet_handler(unsigned char *buffer, uint16_t len) { payload.buffer = pld_buf; payload.size = ECP_MAX_PLD; + if ((buffer == NULL) || (len < EOS_SOCK_SIZE_UDP_HDR)) { + eos_net_free(buffer, 0); + return; + } + eos_sock_getfrom(buffer, &addr); ssize_t rv = ecp_pkt_handle(_ecp_tr_sock, &addr, NULL, &bufs, len-EOS_SOCK_SIZE_UDP_HDR); #ifdef ECP_DEBUG -- cgit v1.2.3