Fixed bug #49209: netconn_drain() fails to handle 'netconn_aborted' pointer

This commit is contained in:
goldsimon 2016-09-28 12:53:07 +02:00
parent 5d811d799c
commit 0e2354e658

View File

@ -780,7 +780,8 @@ netconn_drain(struct netconn *conn)
/* Delete and drain the acceptmbox. */
#if LWIP_TCP
if (sys_mbox_valid(&conn->acceptmbox)) {
while (sys_mbox_tryfetch(&conn->acceptmbox, &mem) != SYS_MBOX_EMPTY) {
while ((sys_mbox_tryfetch(&conn->acceptmbox, &mem) != SYS_MBOX_EMPTY) &&
(mem != &netconn_aborted)) {
struct netconn *newconn = (struct netconn *)mem;
/* Only tcp pcbs have an acceptmbox, so no need to check conn->type */
/* pcb might be set to NULL already by err_tcp() */