mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 18:14:53 +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
This commit is contained in:
parent
c3912e35f6
commit
9e20fe2cfb
@ -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