diff --git a/src/modules/rlm_eap/eap.c b/src/modules/rlm_eap/eap.c index 7478f7c7081f..477c739a2d21 100644 --- a/src/modules/rlm_eap/eap.c +++ b/src/modules/rlm_eap/eap.c @@ -162,14 +162,14 @@ int eap_module_load(rlm_eap_t *inst, eap_module_t **m_inst, eap_type_t num, CONF radlog(L_ERR, "rlm_eap (%s): Failed to initialise %s", inst->xlat_name, mod_name); if (method->instance) { - talloc_steal(method, method->instance); + (void) talloc_steal(method, method->instance); } return -1; } if (method->instance) { - talloc_steal(method, method->instance); + (void) talloc_steal(method, method->instance); } return 0; @@ -996,7 +996,7 @@ static EAP_DS *eap_buildds(eap_handler_t *handler, } eap_ds->response->packet = (uint8_t *) eap_packet; - talloc_steal(eap_ds, eap_packet); + (void) talloc_steal(eap_ds, eap_packet); eap_ds->response->code = eap_packet->code; eap_ds->response->id = eap_packet->id; eap_ds->response->type.num = eap_packet->data[0]; diff --git a/src/modules/rlm_eap/libeap/eap_tls.c b/src/modules/rlm_eap/libeap/eap_tls.c index 9885df15d211..093dbcd4ca30 100644 --- a/src/modules/rlm_eap/libeap/eap_tls.c +++ b/src/modules/rlm_eap/libeap/eap_tls.c @@ -110,8 +110,7 @@ tls_session_t *eaptls_session(fr_tls_server_conf_t *tls_conf, eap_handler_t *han #endif SSL_set_ex_data(ssn->ssl, FR_TLS_EX_INDEX_SSN, (void *)ssn); - talloc_steal(handler, ssn); - return ssn; + return talloc_steal(handler, ssn); /* ssn */ } /* diff --git a/src/modules/rlm_eap/rlm_eap.c b/src/modules/rlm_eap/rlm_eap.c index 65460e23006e..224dda44c08e 100644 --- a/src/modules/rlm_eap/rlm_eap.c +++ b/src/modules/rlm_eap/rlm_eap.c @@ -186,11 +186,11 @@ static int mod_instantiate(CONF_SECTION *cs, void *instance) (void) talloc_get_type_abort(inst->methods[method], eap_module_t); if (ret < 0) { - talloc_steal(inst, inst->methods[method]); + (void) talloc_steal(inst, inst->methods[method]); return -1; } - talloc_steal(inst, inst->methods[method]); + (void) talloc_steal(inst, inst->methods[method]); num_methods++; /* successfully loaded one more methods */ } diff --git a/src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c b/src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c index 5afafec6d6da..5d3a80d5aff8 100644 --- a/src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c +++ b/src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c @@ -58,7 +58,7 @@ static int eap_sim_compose(eap_handler_t *handler) static int eap_sim_sendstart(eap_handler_t *handler) { VALUE_PAIR **vps, *newvp; - uint16_t *words; + uint16_t words[3]; struct eap_sim_server_state *ess; RADIUS_PACKET *packet; @@ -78,12 +78,14 @@ static int eap_sim_sendstart(eap_handler_t *handler) */ /* the version list. We support only version 1. */ - newvp = paircreate(packet, ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_VERSION_LIST, 0); - words = (uint16_t *)newvp->vp_strvalue; - newvp->length = 3*sizeof(uint16_t); - words[0] = htons(1*sizeof(uint16_t)); + words[0] = htons(sizeof(words[1])); words[1] = htons(EAP_SIM_VERSION); words[2] = 0; + + newvp = paircreate(packet, ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_VERSION_LIST, 0); + memcpy(newvp->vp_octets, words, sizeof(words)); + newvp->length = sizeof(words); + pairadd(vps, newvp); /* set the EAP_ID - new value */