aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEduardo Abinader <eduardoabinader@gmail.com>2016-08-17 17:29:39 (GMT)
committerJouni Malinen <j@w1.fi>2016-08-19 09:16:20 (GMT)
commit833d0d45e8bc625fae856ccfa895f8ed01fcd2cd (patch)
treeec53420f85a0123187d92240962f24bad3209ad0 /src
parentd015bb05df1e1c2b12060bd7ffa51dc980585f4f (diff)
downloadhostap-833d0d45e8bc625fae856ccfa895f8ed01fcd2cd.zip
hostap-833d0d45e8bc625fae856ccfa895f8ed01fcd2cd.tar.gz
hostap-833d0d45e8bc625fae856ccfa895f8ed01fcd2cd.tar.bz2
radius: Sanity check for NULL pointer segfault
When the RADIUS client has not yet been fully enabled, MIB command was segfaulting hostapd. Signed-off-by: Eduardo Abinader <eduardoabinader@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/radius/radius_client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
index a4edd5f..06c804d 100644
--- a/src/radius/radius_client.c
+++ b/src/radius/radius_client.c
@@ -1636,11 +1636,16 @@ static int radius_client_dump_acct_server(char *buf, size_t buflen,
int radius_client_get_mib(struct radius_client_data *radius, char *buf,
size_t buflen)
{
- struct hostapd_radius_servers *conf = radius->conf;
+ struct hostapd_radius_servers *conf;
int i;
struct hostapd_radius_server *serv;
int count = 0;
+ if (!radius)
+ return 0;
+
+ conf = radius->conf;
+
if (conf->auth_servers) {
for (i = 0; i < conf->num_auth_servers; i++) {
serv = &conf->auth_servers[i];