aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2013-06-27 21:51:25 -0700
committerAleksander Morgado <aleksander@lanedo.com>2013-06-28 07:35:59 +0200
commit989210bfd87da57bc729a0b09720d6bc5f7fcb5c (patch)
tree27b41f7f8ab06c23e620a510c8c1c0c1d4cdc7b4
parent5be1ce6ee165373288ea6852d6148f724b61e68f (diff)
altair-lte: propagate error when load_{supported,current}_bands fails
This patch fixes a potential crash when MMIfaceModem::load_current_bands_ready() dereferences a NULL GError pointer, which happens when the altair-lte plugin fails to load the current bands but does not propagate the error. It also fixes a similar issue with the plugin fails to load the supported bands, even though MMIfaceModem::load_supported_bands_ready() checks for a NULL GError pointer.
-rw-r--r--plugins/altair/mm-broadband-modem-altair-lte.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/altair/mm-broadband-modem-altair-lte.c b/plugins/altair/mm-broadband-modem-altair-lte.c
index 4eeae1c5..a2ae2bab 100644
--- a/plugins/altair/mm-broadband-modem-altair-lte.c
+++ b/plugins/altair/mm-broadband-modem-altair-lte.c
@@ -286,7 +286,9 @@ load_supported_bands_finish (MMIfaceModem *self,
GAsyncResult *res,
GError **error)
{
- /* Never fails */
+ if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
+ return NULL;
+
return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer (
G_SIMPLE_ASYNC_RESULT (res)));
}
@@ -365,7 +367,9 @@ load_current_bands_finish (MMIfaceModem *self,
GAsyncResult *res,
GError **error)
{
- /* Never fails */
+ if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
+ return NULL;
+
return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer (
G_SIMPLE_ASYNC_RESULT (res)));
}