mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08: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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(pppos, 0, sizeof(pppos_pcb));
|
||||||
pppos->ppp = ppp;
|
pppos->ppp = ppp;
|
||||||
pppos->output_cb = output_cb;
|
pppos->output_cb = output_cb;
|
||||||
return ppp;
|
return ppp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user