Bugfix: check the size of the outgoing packet to avoid overflowing the output buffer
This commit is contained in:
parent
843d2361dc
commit
2ba293a538
1 changed files with 2 additions and 1 deletions
|
@ -54,7 +54,8 @@ uip_udp_packet_send(struct uip_udp_conn *c, const void *data, int len)
|
|||
uip_udp_conn = c;
|
||||
uip_slen = len;
|
||||
memcpy(&uip_buf[UIP_LLH_LEN + UIP_IPUDPH_LEN], data,
|
||||
len > UIP_BUFSIZE? UIP_BUFSIZE: len);
|
||||
len > UIP_BUFSIZE - UIP_LLH_LEN - UIP_IPUDPH_LEN?
|
||||
UIP_BUFSIZE - UIP_LLH_LEN - UIP_IPUDPH_LEN: len);
|
||||
uip_process(UIP_UDP_SEND_CONN);
|
||||
#if UIP_CONF_IPV6
|
||||
tcpip_ipv6_output();
|
||||
|
|
Loading…
Add table
Reference in a new issue