diff --git a/0001-mbimcli-intel-tools-parse-trace-command-value-in-a-m.patch b/0001-mbimcli-intel-tools-parse-trace-command-value-in-a-m.patch new file mode 100644 index 0000000000000000000000000000000000000000..190789ebcc4a375d16c5bdaade8ad93fa73c9585 --- /dev/null +++ b/0001-mbimcli-intel-tools-parse-trace-command-value-in-a-m.patch @@ -0,0 +1,51 @@ +From 65d02fc647c42b7c743690c769d4bc2c6f2a69c9 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 23 May 2024 00:03:53 +0200 +Subject: [PATCH] mbimcli-intel-tools: parse trace command & value in a more + straightforward way + +Don't conditionalize setting trace_command and trace_value on split +substrings being non-NULL. It makes a static analysis tool think they +might be used uninitialized. That can-not happen, because the substrings +can in fact never be NULL. + +Let's keep the check in form of an assert (perhaps to guard against +a possible glib bug, etc.). +--- + src/mbimcli/mbimcli-intel-tools.c | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +diff --git a/src/mbimcli/mbimcli-intel-tools.c b/src/mbimcli/mbimcli-intel-tools.c +index 9faab2b8..8ab47c76 100644 +--- a/src/mbimcli/mbimcli-intel-tools.c ++++ b/src/mbimcli/mbimcli-intel-tools.c +@@ -203,18 +203,16 @@ mbimcli_intel_tools_run (MbimDevice *device, + return; + } + +- if (split[0]) { +- if (!mbimcli_read_trace_command_from_string (split[0], &trace_command)) { +- g_printerr ("error: couldn't parse input string, invalid trace command '%s'\n", split[0]); +- return; +- } ++ g_return_if_fail (split[0] && split[1]); ++ ++ if (!mbimcli_read_trace_command_from_string (split[0], &trace_command)) { ++ g_printerr ("error: couldn't parse input string, invalid trace command '%s'\n", split[0]); ++ return; + } + +- if (split[1]) { +- if (!mbimcli_read_uint_from_string (split[1], &trace_value)) { +- g_printerr ("error: couldn't parse input string, invalid trace value '%s'\n", split[1]); +- return; +- } ++ if (!mbimcli_read_uint_from_string (split[1], &trace_value)) { ++ g_printerr ("error: couldn't parse input string, invalid trace value '%s'\n", split[1]); ++ return; + } + + g_debug ("Asynchronously setting trace info..."); +-- +GitLab + diff --git a/0002-mbimcli-intel-thermal-rf-fix-a-potential-mem-leak-in.patch b/0002-mbimcli-intel-thermal-rf-fix-a-potential-mem-leak-in.patch new file mode 100644 index 0000000000000000000000000000000000000000..ede2f3c7b089bbbeb39b6b2558f24366820b82d9 --- /dev/null +++ b/0002-mbimcli-intel-thermal-rf-fix-a-potential-mem-leak-in.patch @@ -0,0 +1,43 @@ +From 9c42e9d1d6d124907dc17e77a97d2a3023552f1e Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Wed, 22 May 2024 17:49:17 +0200 +Subject: [PATCH] mbimcli-intel-thermal-rf: fix a potential mem leak in + query_rfim_ready() + +These were autofree'd on function return, but can actually be assigned +new allocations on each inner loop interation. Move them inside the +loop. +--- + src/mbimcli/mbimcli-intel-thermal-rf.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/src/mbimcli/mbimcli-intel-thermal-rf.c b/src/mbimcli/mbimcli-intel-thermal-rf.c +index 04f477ea..901e7aa9 100644 +--- a/src/mbimcli/mbimcli-intel-thermal-rf.c ++++ b/src/mbimcli/mbimcli-intel-thermal-rf.c +@@ -125,10 +125,6 @@ query_rfim_ready (MbimDevice *device, + g_autoptr(GError) error = NULL; + guint32 element_count; + MbimIntelRfimFrequencyValueArray *rfim_frequency; +- g_autofree gchar *rssi_str = NULL; +- g_autofree gchar *sinr_str = NULL; +- g_autofree gchar *rsrq_str = NULL; +- g_autofree gchar *rsrp_str = NULL; + + response = mbim_device_command_finish (device, res, &error); + if (!response || !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error)) { +@@ -151,6 +147,11 @@ query_rfim_ready (MbimDevice *device, + element_count); + + for (i = 0; i < element_count; i++) { ++ g_autofree gchar *rssi_str = NULL; ++ g_autofree gchar *sinr_str = NULL; ++ g_autofree gchar *rsrq_str = NULL; ++ g_autofree gchar *rsrp_str = NULL; ++ + if (rfim_frequency[i]->rssi <= 31) + rssi_str = g_strdup_printf ("%d dBm", -113 + (2 * rfim_frequency[i]->rssi)); + else +-- +GitLab + diff --git a/libmbim-1.26.4.tar.xz b/libmbim-1.26.4.tar.xz deleted file mode 100644 index 33c7b15443e28130823da6b8c559521322834058..0000000000000000000000000000000000000000 Binary files a/libmbim-1.26.4.tar.xz and /dev/null differ diff --git a/libmbim-1.30.0.tar.bz2 b/libmbim-1.30.0.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..8728f6cf138b9b7d0e1d23b1995975ea5c063f83 Binary files /dev/null and b/libmbim-1.30.0.tar.bz2 differ diff --git a/libmbim.spec b/libmbim.spec index d98e9a354dab492634236b62abdacc77a09594cb..ba489bb1a966100cca3867c2430cbc15befef9c9 100644 --- a/libmbim.spec +++ b/libmbim.spec @@ -1,17 +1,24 @@ %define anolis_release 1 Name: libmbim -Version: 1.26.4 +Version: 1.30.0 Release: %{anolis_release}%{?dist} Summary: Support library for the Mobile Broadband Interface Model protocol -License: LGPLv2+ -URL: http://freedesktop.org/software/libmbim -Source: http://freedesktop.org/software/libmbim/%{name}-%{version}.tar.xz +License: LGPL-2.1-or-later +URL: https://gitlab.freedesktop.org/mobile-broadband/libmbim/ +Source: https://gitlab.freedesktop.org/mobile-broadband/libmbim/-/archive/%{version}/%{name}-%{version}.tar.bz2 + +# https://gitlab.freedesktop.org/mobile-broadband/libmbim/-/commit/65d02fc647c42b7c743690c769d4bc2c6f2a69c9 +Patch0001: 0001-mbimcli-intel-tools-parse-trace-command-value-in-a-m.patch +# https://gitlab.freedesktop.org/mobile-broadband/libmbim/-/commit/9c42e9d1d6d124907dc17e77a97d2a3023552f1e +Patch0002: 0002-mbimcli-intel-thermal-rf-fix-a-potential-mem-leak-in.patch BuildRequires: gcc BuildRequires: gtk-doc -BuildRequires: make +BuildRequires: meson +BuildRequires: gobject-introspection-devel BuildRequires: python3 +BuildRequires: help2man BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(gio-unix-2.0) BuildRequires: pkgconfig(glib-2.0) >= 2.56 @@ -52,46 +59,53 @@ functionality from the command line. %build -%configure --disable-static --enable-gtk-doc -%{make_build} +%meson -Dgtk_doc=true -Dbash_completion=false +%meson_build %install -%{make_install} -find %{buildroot}%{_datadir}/gtk-doc |xargs touch --reference configure.ac +%meson_install +find %{buildroot}%{_datadir}/gtk-doc |xargs touch --reference meson.build %generate_compatibility_deps %check -%make_build check - +%meson_test %files %dir %{abidir} -%license COPYING.LIB %{_libdir}/libmbim-glib.so.4* %{abidir}/libmbim-glib*.dump +%{_libdir}/girepository-1.0/Mbim-1.0.typelib %files doc -%doc NEWS AUTHORS README +%doc NEWS AUTHORS %files devel %{_includedir}/libmbim-glib/ %{_libdir}/pkgconfig/mbim-glib.pc %{_libdir}/libmbim-glib.so %{_datadir}/gtk-doc/html/libmbim-glib/ +%{_datadir}/gir-1.0/Mbim-1.0.gir %files utils -%license COPYING %{_bindir}/mbimcli %{_bindir}/mbim-network %{abidir}/mbimcli-option.list %{abidir}/mbim-network-option.list -%{_datadir}/bash-completion %{_libexecdir}/mbim-proxy %{_mandir}/man1/mbim* %changelog +* Mon Feb 17 2025 mgb01105731 - 1.30.0-1 +- Update to 1.30.0 from 1.26.4 +- switch to build using meson +- Migrate to SPDX license +- Add patches to parse trace command & value in a more straightforward way +- Add patches to fix a potential mem leak in query_rfim_ready() + [Patches cherry-pick from c10s. Original changelog: + - Add patches for a pair of bugs that make static analysis unhappy(1.30.0-5)] + * Mon Nov 21 2022 Funda Wang - 1.26.4-1 - New version 1.26.4