mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-18 20:10:53 +00:00
Fixed bug #27252: Address pointer invalid after freeing pbuf in UDP receive callback
This commit is contained in:
parent
0e91e2adf2
commit
362a295e06
@ -25,6 +25,10 @@ HISTORY
|
||||
|
||||
++ Bugfixes:
|
||||
|
||||
2009-08-23 Simon Goldschmidt
|
||||
* udp.c: bug #27252: Address pointer invalid after freeing pbuf in UDP
|
||||
receive callback
|
||||
|
||||
2009-08-23 Simon Goldschmidt
|
||||
* many ppp files: bug #27267: Added include to string.h where needed
|
||||
|
||||
|
@ -281,8 +281,10 @@ udp_input(struct pbuf *p, struct netif *inp)
|
||||
snmp_inc_udpindatagrams();
|
||||
/* callback */
|
||||
if (pcb->recv != NULL) {
|
||||
/* copy the source address to make it independent of the pbuf */
|
||||
struct ip_addr src_addr = iphdr->src;
|
||||
/* now the recv function is responsible for freeing p */
|
||||
pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src), src);
|
||||
pcb->recv(pcb->recv_arg, pcb, p, &src_addr, src);
|
||||
} else {
|
||||
/* no recv function registered? then we have to free the pbuf! */
|
||||
pbuf_free(p);
|
||||
|
Loading…
Reference in New Issue
Block a user