[PATCH] mm-modem-helpers-qmi: avoid SIGSEGV with mmcli --set-current-bands
Dan Williams
dcbw at redhat.com
Fri Aug 23 21:51:26 UTC 2019
On Mon, 2019-08-19 at 16:31 +0200, Reinhard Speyerer wrote:
> For devices which do not provide feature_extended_lte_band_preference
> mm_modem_bands_to_qmi_band_preference() gets called from
> mm_shared_qmi_set_current_bands() with extended_qmi_lte_bands
> set to NULL which may cause a SIGSEGV in the memset() call in
> mm_modem_bands_to_qmi_band_preference().
>
> Avoid this by checking whether extended_qmi_lte_bands is non-NULL
> before calling memset().
Thanks, pushed as MR:
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merge_requests/140
along with the other 2 mm-modem-helpers-qmi patches you posted this
week.
Dan
> Reported-by: Nick <mips171 at icloud.com>
> ---
> diff --git a/src/mm-modem-helpers-qmi.c b/src/mm-modem-helpers-qmi.c
> index 86e1803b..a0bc4f4a 100644
> --- a/src/mm-modem-helpers-qmi.c
> +++ b/src/mm-modem-helpers-qmi.c
> @@ -567,7 +567,8 @@ mm_modem_bands_to_qmi_band_preference (GArray
> *mm_bands,
>
> *qmi_bands = 0;
> *qmi_lte_bands = 0;
> - memset (extended_qmi_lte_bands, 0, extended_qmi_lte_bands_size *
> sizeof (guint64));
> + if (extended_qmi_lte_bands)
> + memset (extended_qmi_lte_bands, 0,
> extended_qmi_lte_bands_size * sizeof (guint64));
>
> for (i = 0; i < mm_bands->len; i++) {
> MMModemBand band;
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
More information about the ModemManager-devel
mailing list