mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-04 11:38:11 +00:00
Another fix for bug #28562: Segfault @ err_tcp
This commit is contained in:
parent
0e38a52edc
commit
9521f54741
@ -619,7 +619,10 @@ netconn_drain(struct netconn *conn)
|
|||||||
if (conn->type == NETCONN_TCP) {
|
if (conn->type == NETCONN_TCP) {
|
||||||
if(mem != NULL) {
|
if(mem != NULL) {
|
||||||
p = (struct pbuf*)mem;
|
p = (struct pbuf*)mem;
|
||||||
tcp_recved(conn->pcb.tcp, p->tot_len);
|
/* pcb might be set to NULL already by err_tcp() */
|
||||||
|
if (conn->pcb.tcp != NULL) {
|
||||||
|
tcp_recved(conn->pcb.tcp, p->tot_len);
|
||||||
|
}
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -634,7 +637,11 @@ netconn_drain(struct netconn *conn)
|
|||||||
conn->acceptmbox = SYS_MBOX_NULL;
|
conn->acceptmbox = SYS_MBOX_NULL;
|
||||||
if (mbox != SYS_MBOX_NULL) {
|
if (mbox != SYS_MBOX_NULL) {
|
||||||
while (sys_mbox_tryfetch(mbox, &mem) != SYS_MBOX_EMPTY) {
|
while (sys_mbox_tryfetch(mbox, &mem) != SYS_MBOX_EMPTY) {
|
||||||
tcp_accepted(conn->pcb.tcp);
|
/* Only tcp pcbs have an acceptmbox, so no need to check conn->type */
|
||||||
|
/* pcb might be set to NULL already by err_tcp() */
|
||||||
|
if (conn->pcb.tcp != NULL) {
|
||||||
|
tcp_accepted(conn->pcb.tcp);
|
||||||
|
}
|
||||||
netconn_delete((struct netconn *)mem);
|
netconn_delete((struct netconn *)mem);
|
||||||
}
|
}
|
||||||
sys_mbox_free(mbox);
|
sys_mbox_free(mbox);
|
||||||
|
Loading…
Reference in New Issue
Block a user