diff options
author | Vladislav Grishenko <themiron@mail.ru> | 2018-03-04 02:29:46 +0500 |
---|---|---|
committer | Vladislav Grishenko <themiron@mail.ru> | 2018-03-04 02:41:47 +0500 |
commit | 939e952452dd856a574a1d78c15181a93a593996 (patch) | |
tree | 3e6b12fab35b12cda2be553faec05755a598d4da /accel-pppd/radius | |
parent | 5ccf2f0409c18e216c4da5c7cce5e9fcf14ebf54 (diff) | |
download | accel-ppp-939e952452dd856a574a1d78c15181a93a593996.tar.gz accel-ppp-939e952452dd856a574a1d78c15181a93a593996.zip |
fix possible null pointer dereferences
Diffstat (limited to 'accel-pppd/radius')
-rw-r--r-- | accel-pppd/radius/backup.c | 7 |
1 files changed, 5 insertions, 2 deletions
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) |