mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-16 14:11:02 +00:00
Apply [patch #9287] Possible null-pointer dereference from Mikhail Lappo in a modified way
Moved the debug output to a location where we know that newpcb != NULL
Fixes possible NULL pointer dereferencing in debug message output
(cherry picked from commit 9e20fe2cfb
)
This commit is contained in:
parent
f5438b1b43
commit
0623dc4038
@ -471,8 +471,6 @@ accept_function(void *arg, struct tcp_pcb *newpcb, err_t err)
|
|||||||
struct netconn *newconn;
|
struct netconn *newconn;
|
||||||
struct netconn *conn = (struct netconn *)arg;
|
struct netconn *conn = (struct netconn *)arg;
|
||||||
|
|
||||||
LWIP_DEBUGF(API_MSG_DEBUG, ("accept_function: newpcb->tate: %s\n", tcp_debug_state_str(newpcb->state)));
|
|
||||||
|
|
||||||
if (conn == NULL) {
|
if (conn == NULL) {
|
||||||
return ERR_VAL;
|
return ERR_VAL;
|
||||||
}
|
}
|
||||||
@ -490,6 +488,8 @@ accept_function(void *arg, struct tcp_pcb *newpcb, err_t err)
|
|||||||
return ERR_VAL;
|
return ERR_VAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LWIP_DEBUGF(API_MSG_DEBUG, ("accept_function: newpcb->tate: %s\n", tcp_debug_state_str(newpcb->state)));
|
||||||
|
|
||||||
/* We have to set the callback here even though
|
/* We have to set the callback here even though
|
||||||
* the new socket is unknown. newconn->socket is marked as -1. */
|
* the new socket is unknown. newconn->socket is marked as -1. */
|
||||||
newconn = netconn_alloc(conn->type, conn->callback);
|
newconn = netconn_alloc(conn->type, conn->callback);
|
||||||
|
Loading…
Reference in New Issue
Block a user