mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-23 22:56:00 +00:00
Found a little bug in ARP_QUEUEING: if pbuf_alloc for the packet to be queued failed, pbuf_copy was called with a NULL pointer.
This commit is contained in:
parent
3c32c993f5
commit
6c39b8a10c
|
@ -865,10 +865,12 @@ err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q)
|
||||||
if(copy_needed) {
|
if(copy_needed) {
|
||||||
/* copy the whole packet into new pbufs */
|
/* copy the whole packet into new pbufs */
|
||||||
p = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
|
p = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
|
||||||
|
if(p != NULL) {
|
||||||
if (pbuf_copy(p, q) != ERR_OK) {
|
if (pbuf_copy(p, q) != ERR_OK) {
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
p = NULL;
|
p = NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* referencing the old pbuf is enough */
|
/* referencing the old pbuf is enough */
|
||||||
p = q;
|
p = q;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user