EAP-FAST: Use clear eap_get_config() result validation
This was previously checked through the eap_peer_tls_ssl_init() call which made it difficult for static analyzers. Add an explicit check for config == NULL into the beginnign of eap_fast_init() since this will always result in initialization failing anyway. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
a8716d13bf
commit
3ff8073db7
1 changed files with 4 additions and 2 deletions
|
@ -149,14 +149,16 @@ static void * eap_fast_init(struct eap_sm *sm)
|
||||||
struct eap_fast_data *data;
|
struct eap_fast_data *data;
|
||||||
struct eap_peer_config *config = eap_get_config(sm);
|
struct eap_peer_config *config = eap_get_config(sm);
|
||||||
|
|
||||||
|
if (config == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
data = os_zalloc(sizeof(*data));
|
data = os_zalloc(sizeof(*data));
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
data->fast_version = EAP_FAST_VERSION;
|
data->fast_version = EAP_FAST_VERSION;
|
||||||
data->max_pac_list_len = 10;
|
data->max_pac_list_len = 10;
|
||||||
|
|
||||||
if (config && config->phase1 &&
|
if (config->phase1 && eap_fast_parse_phase1(data, config->phase1) < 0) {
|
||||||
eap_fast_parse_phase1(data, config->phase1) < 0) {
|
|
||||||
eap_fast_deinit(sm, data);
|
eap_fast_deinit(sm, data);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue