aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-06-13 10:25:38 +0200
committerAleksander Morgado <aleksander@aleksander.es>2019-06-13 10:26:53 +0200
commit20c5d7fd922bfbf5d611c5c5b6cf78cb438437e0 (patch)
treecb9f4627930bca6de55d7e4f23771f09e757dc5b
parentd19738009595c3ad39c1629e61b6df99a422a990 (diff)
ublox: return error when no bands are parsed
If load_current_bands_finish() returns a NULL GArray, we must set the GError or otherwise the daemon will segfault when the caller dereferences the GError: current_bands = MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_bands_finish (self, res, &error); if (!current_bands) { /* Errors when getting current bands won't be critical */ mm_warn ("couldn't load current Bands: '%s'", error->message); g_error_free (error); } This may happen with an empty but balid +UACT response, e.g.: AT+UACT? +UACT: ,,, OK Or when it replies a full empty string: AT+UACT? OK
-rw-r--r--plugins/ublox/mm-modem-helpers-ublox.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/ublox/mm-modem-helpers-ublox.c b/plugins/ublox/mm-modem-helpers-ublox.c
index 8608960b..df6b6a26 100644
--- a/plugins/ublox/mm-modem-helpers-ublox.c
+++ b/plugins/ublox/mm-modem-helpers-ublox.c
@@ -1578,6 +1578,10 @@ mm_ublox_parse_uact_response (const gchar *response,
g_array_unref (nums);
}
+ if (!bands)
+ g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
+ "No known band selection values matched in +UACT response: '%s'", response);
+
return bands;
}