From 939e952452dd856a574a1d78c15181a93a593996 Mon Sep 17 00:00:00 2001 From: Vladislav Grishenko Date: Sun, 4 Mar 2018 02:29:46 +0500 Subject: fix possible null pointer dereferences --- accel-pppd/radius/backup.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'accel-pppd/radius') diff --git a/accel-pppd/radius/backup.c b/accel-pppd/radius/backup.c index 93ab3eb0..46041d78 100644 --- a/accel-pppd/radius/backup.c +++ b/accel-pppd/radius/backup.c @@ -30,8 +30,8 @@ static int session_save(struct ap_session *ses, struct backup_mod *m) { struct radius_pd_t *rpd = find_pd(ses); - uint64_t session_timeout = ses->start_time + rpd->session_timeout.expire_tv.tv_sec; - uint32_t idle_timeout = rpd->idle_timeout.period / 1000; + uint64_t session_timeout; + uint32_t idle_timeout; if (!rpd) return 0; @@ -39,6 +39,9 @@ static int session_save(struct ap_session *ses, struct backup_mod *m) if (!rpd->authenticated) return -2; + session_timeout = ses->start_time + rpd->session_timeout.expire_tv.tv_sec; + idle_timeout = rpd->idle_timeout.period / 1000; + add_tag(RAD_TAG_INTERIM_INTERVAL, &rpd->acct_interim_interval, 4); if (rpd->session_timeout.tpd) -- cgit v1.2.3