From b36ad87dd441b253d1756936660fa728425ac113 Mon Sep 17 00:00:00 2001 From: Fabien Marotte Date: Thu, 16 Sep 2010 09:52:43 +0200 Subject: Fix a crash when doing PEAP/TTLS authentication When doing a PEAP/TTLS authentication, if the Phase2 passphrase is not provided, connman crashes due to a NULL pointer. This patch fixes the crash. Fixes BMC #6841 --- plugins/supplicant.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins') diff --git a/plugins/supplicant.c b/plugins/supplicant.c index 928bacc4..6bfcd458 100644 --- a/plugins/supplicant.c +++ b/plugins/supplicant.c @@ -1144,6 +1144,12 @@ static int set_network_peap(struct connman_network *network, * The Client private key file * The Client private key file password */ + if (passphrase == NULL) { + connman_error("Error in PEAP/TTLS authentication: " + "a phase2 passphrase must be defined\n"); + return -EINVAL; + } + ca_cert = connman_network_get_string(network, "WiFi.CACertFile"); if (ca_cert == NULL) { connman_error("Error in PEAP/TTLS authentication: " -- cgit v1.2.3