network-manager-openvpn r16 - in trunk: . src



Author: dcbw
Date: Wed Jan 28 17:35:59 2009
New Revision: 16
URL: http://svn.gnome.org/viewvc/network-manager-openvpn?rev=16&view=rev

Log:
2009-01-28  Christoph HÃger <choeger cs tu-berlin de>

	* src/nm-openvpn-service.c
		- (real_connect, real_need_secrets): don't segfault if the
			connection type is invalid



Modified:
   trunk/ChangeLog
   trunk/src/nm-openvpn-service.c

Modified: trunk/src/nm-openvpn-service.c
==============================================================================
--- trunk/src/nm-openvpn-service.c	(original)
+++ trunk/src/nm-openvpn-service.c	Wed Jan 28 17:35:59 2009
@@ -874,7 +874,17 @@
 
 	user_name = nm_setting_vpn_get_user_name (s_vpn);
 	tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CONNECTION_TYPE);
+	
 	connection_type = validate_connection_type (tmp);
+	
+	if (!connection_type) {
+		g_set_error (error,
+		             NM_VPN_PLUGIN_ERROR,
+		             NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
+		             "%s",
+		             "Invalid connection type.");
+		return FALSE;
+	}	
 
 	/* Need a username for any password-based connection types */
 	if (   !strcmp (connection_type, NM_OPENVPN_CONTYPE_PASSWORD_TLS)
@@ -932,6 +942,15 @@
 
 	tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CONNECTION_TYPE);
 	connection_type = validate_connection_type (tmp);
+	
+	if (!connection_type) {
+		g_set_error (error,
+		             NM_VPN_PLUGIN_ERROR,
+		             NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
+		             "%s",
+		             "Invalid connection type.");
+		return FALSE;
+	}
 
 	if (!strcmp (connection_type, NM_OPENVPN_CONTYPE_PASSWORD_TLS)) {
 		/* Will require a password and maybe private key password */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]