aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius
diff options
context:
space:
mode:
authorManeesh Jain <maneesh.jain@samsung.com>2015-06-22 03:32:15 (GMT)
committerJouni Malinen <j@w1.fi>2015-06-26 19:44:41 (GMT)
commit4457f41b545087065680d1755f6ca4e6753e3459 (patch)
tree0cc52e90ad5a55d450990d07d491ca34646d0b11 /src/radius
parentf826fb1de15ccb33899a2a316904c010c0b1ca00 (diff)
downloadhostap-4457f41b545087065680d1755f6ca4e6753e3459.zip
hostap-4457f41b545087065680d1755f6ca4e6753e3459.tar.gz
hostap-4457f41b545087065680d1755f6ca4e6753e3459.tar.bz2
radius: Fix NULL dereference issue on allocation failure
In case memory allocation fails, data->pac_opaque_encr_key may be NULL and lead to possible crash. Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
Diffstat (limited to 'src/radius')
-rw-r--r--src/radius/radius_server.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/radius/radius_server.c b/src/radius/radius_server.c
index 1c69955..bdb7e42 100644
--- a/src/radius/radius_server.c
+++ b/src/radius/radius_server.c
@@ -1711,8 +1711,10 @@ radius_server_init(struct radius_server_conf *conf)
data->ipv6 = conf->ipv6;
if (conf->pac_opaque_encr_key) {
data->pac_opaque_encr_key = os_malloc(16);
- os_memcpy(data->pac_opaque_encr_key, conf->pac_opaque_encr_key,
- 16);
+ if (data->pac_opaque_encr_key) {
+ os_memcpy(data->pac_opaque_encr_key,
+ conf->pac_opaque_encr_key, 16);
+ }
}
if (conf->eap_fast_a_id) {
data->eap_fast_a_id = os_malloc(conf->eap_fast_a_id_len);