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.
This commit is contained in:
Aleksander Morgado
2020-08-16 11:13:26 +02:00
parent 55ae47a3bb
commit de23b53ee4

View File

@@ -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,