diff options
| author | xebd <xeb@mail.ru> | 2021-03-17 11:30:45 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-17 11:30:45 +0300 |
| commit | 02ee3cf8abebec16bf9106426e095495144c3d2f (patch) | |
| tree | d871c149812c68b7ceee591f6bb265f4ad643414 /accel-pppd/radius | |
| parent | 49ef6cf969f662c44f4be2b82b101273c8c6de71 (diff) | |
| parent | 2785d81ec848ebb920c8a612b4eae7876a619a18 (diff) | |
| download | accel-ppp-02ee3cf8abebec16bf9106426e095495144c3d2f.tar.gz accel-ppp-02ee3cf8abebec16bf9106426e095495144c3d2f.zip | |
Merge pull request #153 from anphsw/master
Some bugfixes found by cppcheck
Diffstat (limited to 'accel-pppd/radius')
| -rw-r--r-- | accel-pppd/radius/radius.c | 7 | ||||
| -rw-r--r-- | accel-pppd/radius/serv.c | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/accel-pppd/radius/radius.c b/accel-pppd/radius/radius.c index fd64091..139b8b8 100644 --- a/accel-pppd/radius/radius.c +++ b/accel-pppd/radius/radius.c @@ -684,7 +684,6 @@ static void ses_finished(struct ap_session *ses) { struct radius_pd_t *rpd = find_pd(ses); struct ipv6db_addr_t *a; - struct framed_route *fr = rpd->fr; struct framed_ip6_route *fr6; if (!rpd) { @@ -692,6 +691,8 @@ static void ses_finished(struct ap_session *ses) abort(); } + struct framed_route *fr = rpd->fr; + pthread_rwlock_wrlock(&sessions_lock); pthread_mutex_lock(&rpd->lock); list_del(&rpd->entry); @@ -1040,6 +1041,10 @@ static void radius_init(void) { const char *dict = NULL; struct conf_sect_t *s = conf_get_section("radius"); + + if (!s) + _exit(EXIT_FAILURE); + struct conf_option_t *opt1; rpd_pool = mempool_create(sizeof(struct radius_pd_t)); diff --git a/accel-pppd/radius/serv.c b/accel-pppd/radius/serv.c index d27d04f..65af74d 100644 --- a/accel-pppd/radius/serv.c +++ b/accel-pppd/radius/serv.c @@ -758,6 +758,8 @@ static int parse_server2(const char *_opt, struct rad_server_t *s) goto out; ptr2 = strchr(ptr1 + 1, ','); + if (!ptr2) + goto out; *ptr1 = 0; @@ -826,8 +828,7 @@ static int parse_server2(const char *_opt, struct rad_server_t *s) else s->backup = 0; - if (ptr2) - *ptr2 = 0; + *ptr2 = 0; s->secret = _strdup(ptr1 + 1); |
