From 19a0ea6cf9dbfb5dd0d2da2afdfbfdde49dc758c Mon Sep 17 00:00:00 2001 From: Carlo Lobrano Date: Wed, 8 Jun 2022 15:34:49 +0200 Subject: [PATCH] plugins,telit: do not crash if revision is not set In mm_telit_model_from_revision there is nothing that prevents to use the input revision string if it is NULL, which currently happens if the modem is pure MBIM (i.e. LE910-V2 pid:0x0032). Fix the above error returning a default safe value and not using the NULL variable. --- plugins/telit/mm-modem-helpers-telit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/telit/mm-modem-helpers-telit.c b/plugins/telit/mm-modem-helpers-telit.c index 767548ca..c2061fcd 100644 --- a/plugins/telit/mm-modem-helpers-telit.c +++ b/plugins/telit/mm-modem-helpers-telit.c @@ -943,7 +943,8 @@ mm_telit_model_from_revision (const gchar *revision) {"40.", MM_TELIT_MODEL_LN920} }; - g_assert (revision); + if (!revision) + return MM_TELIT_MODEL_DEFAULT; for (i = 0; i < G_N_ELEMENTS (revision_to_model_map); ++i) { if (g_str_has_prefix (revision, revision_to_model_map[i].revision_prefix))