diff options
author | Uros Majstorovic <majstor@majstor.org> | 2019-11-24 16:52:02 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2019-11-24 16:52:02 +0100 |
commit | 150604aa4983f20a200b9f16f5738fd0017368f3 (patch) | |
tree | 15bc44cf08ce4e719735d1e3fe061246babfe28c /code/ecp/fe310 | |
parent | 782d4fd32a33ba6938bc22d428f9981638324293 (diff) |
typo in _tr_release
Diffstat (limited to 'code/ecp/fe310')
-rw-r--r-- | code/ecp/fe310/transport.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 |