diff --git a/providers/gsmloc/geoclue-gsmloc.c b/providers/gsmloc/geoclue-gsmloc.c index 32014f44e0cec29dd7683bdc56b427b3753d7500..3a50fdf1e3d228c54ccd785edfb3000f57d43cbe 100644 --- a/providers/gsmloc/geoclue-gsmloc.c +++ b/providers/gsmloc/geoclue-gsmloc.c @@ -179,6 +179,10 @@ static gboolean geoclue_gsmloc_get_cell (GeoclueGsmloc *gsmloc, } strings = g_strsplit (netinfo.NetworkCode, " ", 2); + if (!strings[0] || !strings[1]) { + g_strfreev (strings); + return FALSE; + } *mcc = strings[0]; *mnc = strings[1]; g_free (strings); @@ -186,7 +190,6 @@ static gboolean geoclue_gsmloc_get_cell (GeoclueGsmloc *gsmloc, *lac = g_strdup_printf ("%d", i_lac); *cid = g_strdup_printf ("%d", i_cid); - /* TODO should make sure all return values have data? */ return TRUE; }