diff options
author | Kozlov Dmitry <dima@server> | 2010-12-02 20:06:03 +0300 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2010-12-02 20:06:03 +0300 |
commit | 0984abada7f7c38510f953a65a8449e8481140dc (patch) | |
tree | 29d10a8637773cd9bbbfceacf5fc1a7b5e930ce7 | |
parent | fd3509f7c4e9052a4e856b9a008c74df3abbe136 (diff) | |
download | accel-ppp-0984abada7f7c38510f953a65a8449e8481140dc.tar.gz accel-ppp-0984abada7f7c38510f953a65a8449e8481140dc.zip |
pppd_compat: fixed incorrect array size
-rw-r--r-- | accel-pptpd/extra/pppd_compat.c | 8 | ||||
-rw-r--r-- | accel-pptpd/extra/sigchld.c | 2 | ||||
-rw-r--r-- | accel-pptpd/ppp/ppp_lcp.c | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/accel-pptpd/extra/pppd_compat.c b/accel-pptpd/extra/pppd_compat.c index 97a89d05..07ff0751 100644 --- a/accel-pptpd/extra/pppd_compat.c +++ b/accel-pptpd/extra/pppd_compat.c @@ -172,8 +172,8 @@ static void ev_ppp_started(struct ppp_t *ppp) pid_t pid; char *argv[8]; char *env[2]; - char ipaddr[16]; - char peer_ipaddr[16]; + char ipaddr[17]; + char peer_ipaddr[17]; char peername[64]; struct pppd_compat_pd_t *pd = find_pd(ppp); @@ -234,8 +234,8 @@ static void ev_ppp_finished(struct ppp_t *ppp) pid_t pid; char *argv[8]; char *env[5]; - char ipaddr[16]; - char peer_ipaddr[16]; + char ipaddr[17]; + char peer_ipaddr[17]; char peername[64]; char connect_time[24]; char bytes_sent[24]; diff --git a/accel-pptpd/extra/sigchld.c b/accel-pptpd/extra/sigchld.c index 240b0ddb..abfd42f1 100644 --- a/accel-pptpd/extra/sigchld.c +++ b/accel-pptpd/extra/sigchld.c @@ -57,13 +57,13 @@ static void* sigchld_thread(void *arg) list_for_each_entry(h, &handlers, entry) { if (h->pid == pid) { h0 = h; + list_del(&h0->entry); pthread_mutex_lock(&h0->lock); break; } } pthread_mutex_unlock(&handlers_lock); if (h0) { - list_del(&h0->entry); h0->handler(h0, WEXITSTATUS(status)); h0->pid = 0; pthread_mutex_unlock(&h0->lock); diff --git a/accel-pptpd/ppp/ppp_lcp.c b/accel-pptpd/ppp/ppp_lcp.c index 8c539a7c..0906ad0d 100644 --- a/accel-pptpd/ppp/ppp_lcp.c +++ b/accel-pptpd/ppp/ppp_lcp.c @@ -176,7 +176,10 @@ static void lcp_layer_finished(struct ppp_fsm_t *fsm) stop_echo(lcp); if (lcp->started) { lcp->started = 0; - ppp_layer_finished(lcp->ppp, &lcp->ld); + if (lcp->ppp->terminating) + ppp_layer_finished(lcp->ppp, &lcp->ld); + else + ppp_terminate(lcp->ppp, TERM_NAS_ERROR, 1); } else ppp_terminate(lcp->ppp, TERM_NAS_ERROR, 1); } |