summaryrefslogtreecommitdiff
path: root/accel-pppd/ppp/ppp_auth.c
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2018-02-21 17:55:53 +0100
committerDmitry Kozlov <xeb@mail.ru>2018-03-03 12:07:39 +0300
commit22b24dc6ceb93dca800c687e72bba89fe68a78ee (patch)
tree605fcc15c2eb3ed595aadf948feaa05ec48a2626 /accel-pppd/ppp/ppp_auth.c
parent6e7c20d8b1eaca421793cc3876c84a0ab718282e (diff)
downloadaccel-ppp-22b24dc6ceb93dca800c687e72bba89fe68a78ee.tar.gz
accel-ppp-22b24dc6ceb93dca800c687e72bba89fe68a78ee.zip
ppp: fix use-after-free in ppp_auth_failed()
The 'username' variable can be freed at the beginning of the function. We have to use ppp->ses.username instead. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/ppp/ppp_auth.c')
-rw-r--r--accel-pppd/ppp/ppp_auth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/accel-pppd/ppp/ppp_auth.c b/accel-pppd/ppp/ppp_auth.c
index 2713874..0eaac35 100644
--- a/accel-pppd/ppp/ppp_auth.c
+++ b/accel-pppd/ppp/ppp_auth.c
@@ -364,8 +364,8 @@ void __export ppp_auth_failed(struct ppp_t *ppp, char *username)
_free(username);
ppp->ses.terminate_cause = TERM_AUTH_ERROR;
pthread_rwlock_unlock(&ses_lock);
- log_ppp_info1("%s: authentication failed\n", username);
- log_info1("%s: authentication failed\n", username);
+ log_ppp_info1("%s: authentication failed\n", ppp->ses.username);
+ log_info1("%s: authentication failed\n", ppp->ses.username);
triton_event_fire(EV_SES_AUTH_FAILED, ppp);
} else
log_ppp_info1("authentication failed\n");