mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-03 21:14:40 +08: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:
|
++ 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
|
2009-08-23 Simon Goldschmidt
|
||||||
* many ppp files: bug #27267: Added include to string.h where needed
|
* 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();
|
snmp_inc_udpindatagrams();
|
||||||
/* callback */
|
/* callback */
|
||||||
if (pcb->recv != NULL) {
|
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 */
|
/* 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 {
|
} else {
|
||||||
/* no recv function registered? then we have to free the pbuf! */
|
/* no recv function registered? then we have to free the pbuf! */
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user