From: Fabien Marotte Date: Thu, 16 Sep 2010 07:52:43 +0000 (+0200) Subject: Fix a crash when doing PEAP/TTLS authentication X-Git-Tag: 2.0_alpha~2406 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b36ad87dd441b253d1756936660fa728425ac113;p=framework%2Fconnectivity%2Fconnman.git 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 --- diff --git a/plugins/supplicant.c b/plugins/supplicant.c index 928bacc..6bfcd45 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: "