patch #8008 Fix a potential null pointer dereference in assert

This commit is contained in:
Simon Goldschmidt 2013-04-24 22:28:22 +02:00
parent 252126cf76
commit 097bc4c622
2 changed files with 5 additions and 1 deletions

View File

@ -80,6 +80,9 @@ HISTORY
++ Bugfixes:
2013-04-24: patch by Liam <morepork>
api_msg.c: patch #8008 Fix a potential null pointer dereference in assert
2013-04-24: Simon Goldschmidt
* igmp.c: fixed possible division by zero

View File

@ -222,11 +222,12 @@ recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
LWIP_ASSERT("recv_tcp must have a pcb argument", pcb != NULL);
LWIP_ASSERT("recv_tcp must have an argument", arg != NULL);
conn = (struct netconn *)arg;
LWIP_ASSERT("recv_tcp: recv for wrong pcb!", conn->pcb.tcp == pcb);
if (conn == NULL) {
return ERR_VAL;
}
LWIP_ASSERT("recv_tcp: recv for wrong pcb!", conn->pcb.tcp == pcb);
if (!sys_mbox_valid(&conn->recvmbox)) {
/* recvmbox already deleted */
if (p != NULL) {