helpers: avoid segfault when empty pdp type string is given

https://bugzilla.redhat.com/show_bug.cgi?id=1183250
This commit is contained in:
Aleksander Morgado
2015-01-29 21:28:52 +01:00
parent dc38332224
commit 60cd66b4fa

View File

@@ -1897,6 +1897,8 @@ mm_3gpp_get_pdp_type_from_ip_family (MMBearerIpFamily family)
MMBearerIpFamily
mm_3gpp_get_ip_family_from_pdp_type (const gchar *pdp_type)
{
if (!pdp_type)
return MM_BEARER_IP_FAMILY_NONE;
if (g_str_equal (pdp_type, "IP"))
return MM_BEARER_IP_FAMILY_IPV4;
if (g_str_equal (pdp_type, "IPV4"))