mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-27 15:16:03 +00:00
PPP, PPPoS, fix dereference of uninitialised pppos->in_head pointer
When I create a new PPP connection, I am seeing a hardfault (segfault) coming from pbuf_free. I traced the problem to an invalid in_head field of the pppos_pcb structure. The field is invalid because the memory is never cleared to zero after the pppos_pcb structure is created in pppos_create(). I was able to fix the issue by adding a memset after the memp_malloc call. Signed-off-by: Sylvain Rochet <gradator@gradator.net>
This commit is contained in:
parent
96373f6959
commit
52463fa25b
@ -184,6 +184,7 @@ ppp_pcb *pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(pppos, 0, sizeof(pppos_pcb));
|
||||
pppos->ppp = ppp;
|
||||
pppos->output_cb = output_cb;
|
||||
return ppp;
|
||||
|
Loading…
Reference in New Issue
Block a user