From de23b53ee4d91367b50a960f8b19b2e29449e49a Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sun, 16 Aug 2020 11:13:26 +0200 Subject: modem-helpers: ensure error is set in mm_3gpp_parse_cpms_test_response() If splitting the +CPMS=? response in groups fails, make sure we set the GError when returning FALSE. --- src/mm-modem-helpers.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index f319a925..d080e010 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -2888,8 +2888,11 @@ mm_3gpp_parse_cpms_test_response (const gchar *reply, #define N_EXPECTED_GROUPS 3 split = mm_split_string_groups (mm_strip_tag (reply, "+CPMS:")); - if (!split) + if (!split) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't split +CPMS test response in groups"); return FALSE; + } if (g_strv_length (split) != N_EXPECTED_GROUPS) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, -- cgit v1.2.3-70-g09d2