diff --git a/CHANGELOG b/CHANGELOG index 0dceebf4..f27510eb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -46,6 +46,10 @@ HISTORY ++ Bugfixes: + 2009-12-06: Simon Goldschmidt + * ppp.h/.c: Fixed bug #27079 (Yet another leak in PPP): outpacket_buf can + be statically allocated (like in ucip) + 2009-12-04: Simon Goldschmidt (patch by Ioardan Neshev) * pap.c: patch #6969: PPP: missing PAP authentication UNTIMEOUT diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index 48b8f110..c1e38730 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -235,7 +235,7 @@ struct protent *ppp_protocols[] = { * Buffers for outgoing packets. This must be accessed only from the appropriate * PPP task so that it doesn't need to be protected to avoid collisions. */ -u_char *outpacket_buf[NUM_PPP]; +u_char outpacket_buf[NUM_PPP][PPP_MRU+PPP_HDRLEN]; /*****************************/ @@ -379,7 +379,7 @@ pppHupCB(void *arg) struct ppp_settings ppp_settings; -err_t +void pppInit(void) { struct protent *protp; @@ -396,15 +396,6 @@ pppInit(void) for (i = 0; i < NUM_PPP; i++) { pppControl[i].openFlag = 0; - outpacket_buf[i] = (u_char *)mem_malloc(PPP_MRU+PPP_HDRLEN); - if (!outpacket_buf[i]) { - for (j = 0; j < i; j++) { - /* deallocate all preceding buffers */ - mem_free(outpacket_buf[j]); - } - return ERR_MEM; - } - /* * Initialize to the standard option set. */ @@ -416,8 +407,6 @@ pppInit(void) #if PPPOE_SUPPORT pppoe_init(); #endif /* PPPOE_SUPPORT */ - - return ERR_OK; } void diff --git a/src/netif/ppp/ppp.h b/src/netif/ppp/ppp.h index d5caa0a7..ebc733be 100644 --- a/src/netif/ppp/ppp.h +++ b/src/netif/ppp/ppp.h @@ -333,7 +333,7 @@ struct ppp_addrs { *****************************/ /* Buffers for outgoing packets. */ -extern u_char *outpacket_buf[NUM_PPP]; +extern u_char outpacket_buf[NUM_PPP][PPP_MRU+PPP_HDRLEN]; extern struct ppp_settings ppp_settings; @@ -345,7 +345,7 @@ extern struct protent *ppp_protocols[]; /* Table of pointers to supported protoc ***********************/ /* Initialize the PPP subsystem. */ -err_t pppInit(void); +void pppInit(void); /* Warning: Using PPPAUTHTYPE_ANY might have security consequences. * RFC 1994 says: