!11 [sync] PR-10: fix test failure because of glib2 switching to pcre2
From: @openeuler-sync-bot Reviewed-by: @seuzw Signed-off-by: @seuzw
This commit is contained in:
commit
260a26c4c9
@ -5,12 +5,22 @@
|
||||
|
||||
Name: ModemManager
|
||||
Version: 1.14.8
|
||||
Release: 1
|
||||
Release: 2
|
||||
Summary: Mobile broadband modem manager
|
||||
License: GPLv2+
|
||||
URL: https://www.freedesktop.org/wiki/Software/ModemManager/
|
||||
Source: https://www.freedesktop.org/software/ModemManager/%{name}-%{version}.tar.xz
|
||||
|
||||
Patch0: backport-mtk-fix-task-completion-when-loading-supported-modes.patch
|
||||
Patch1: backport-sms-prevent-crash-if-date-is-out-of-range.patch
|
||||
Patch2: backport-core-port-GRegex-GMatchInfo-to-use-autoptr.patch
|
||||
Patch3: backport-serial-parsers-fix-invalid-EXZ-error-parser.patch
|
||||
Patch4: backport-test-modem-helpers-add-EOL-to-strings-matched-with-G_REGEX_NEWLINE_CRLF.patch
|
||||
Patch5: backport-modem-helpers-rework-CGCONTRDP-response-parser.patch
|
||||
Patch6: backport-modem-helpers-cinterion-rework-CNMI-test-response-parser.patch
|
||||
Patch7: backport-modem-helpers-ublox-rework-UIPADDR-response-parser.patch
|
||||
Patch8: backport-modem-helpers-rework-the-CGEV-indication-parser.patch
|
||||
|
||||
BuildRequires: automake autoconf dbus gtk-doc libtool vala-tools vala-devel
|
||||
BuildRequires: gettext-devel glib2-devel gobject-introspection-devel libgudev-devel
|
||||
BuildRequires: libqmi-devel libmbim-devel systemd-devel
|
||||
@ -64,7 +74,7 @@ Vala bindings for ModemManager
|
||||
%package_help
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version}
|
||||
%autosetup -n %{name}-%{version} -p1
|
||||
|
||||
%build
|
||||
autoreconf -if
|
||||
@ -138,6 +148,12 @@ make check
|
||||
%{_datadir}/dbus-1/interfaces/*.xml
|
||||
|
||||
%changelog
|
||||
* Sat Nov 12 2022 gaihuiying <eaglegai@163.com> - 1.14.8-2
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: fix test failure because of glib2 switching to pcre2
|
||||
|
||||
* Wed Jan 27 2021 xihaochen <xihaochen@huawei.com> - 1.14.8-1
|
||||
- Type:requirements
|
||||
- ID:NA
|
||||
|
||||
4327
backport-core-port-GRegex-GMatchInfo-to-use-autoptr.patch
Normal file
4327
backport-core-port-GRegex-GMatchInfo-to-use-autoptr.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,66 @@
|
||||
From e6c40349b81ac2915ce90b7e399eb33719a1fd24 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksander Morgado <aleksandermj@chromium.org>
|
||||
Date: Wed, 24 Aug 2022 16:42:45 +0000
|
||||
Subject: [PATCH] modem-helpers-cinterion: rework CNMI test response parser
|
||||
|
||||
We setup all output variables with g_autoptr() and then use
|
||||
g_steal_pointer() to return the needed ones.
|
||||
---
|
||||
.../cinterion/mm-modem-helpers-cinterion.c | 25 ++++++++-----------
|
||||
1 file changed, 10 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/plugins/cinterion/mm-modem-helpers-cinterion.c b/plugins/cinterion/mm-modem-helpers-cinterion.c
|
||||
index 0bf3a0782..9219bff4d 100644
|
||||
--- a/plugins/cinterion/mm-modem-helpers-cinterion.c
|
||||
+++ b/plugins/cinterion/mm-modem-helpers-cinterion.c
|
||||
@@ -556,12 +556,12 @@ mm_cinterion_parse_cnmi_test (const gchar *response,
|
||||
{
|
||||
g_autoptr(GRegex) r = NULL;
|
||||
g_autoptr(GMatchInfo) match_info = NULL;
|
||||
+ g_autoptr(GArray) tmp_supported_mode = NULL;
|
||||
+ g_autoptr(GArray) tmp_supported_mt = NULL;
|
||||
+ g_autoptr(GArray) tmp_supported_bm = NULL;
|
||||
+ g_autoptr(GArray) tmp_supported_ds = NULL;
|
||||
+ g_autoptr(GArray) tmp_supported_bfr = NULL;
|
||||
GError *inner_error = NULL;
|
||||
- GArray *tmp_supported_mode = NULL;
|
||||
- GArray *tmp_supported_mt = NULL;
|
||||
- GArray *tmp_supported_bm = NULL;
|
||||
- GArray *tmp_supported_ds = NULL;
|
||||
- GArray *tmp_supported_bfr = NULL;
|
||||
|
||||
if (!response) {
|
||||
g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Missing response");
|
||||
@@ -619,25 +619,20 @@ mm_cinterion_parse_cnmi_test (const gchar *response,
|
||||
|
||||
out:
|
||||
if (inner_error) {
|
||||
- g_clear_pointer (&tmp_supported_mode, g_array_unref);
|
||||
- g_clear_pointer (&tmp_supported_mt, g_array_unref);
|
||||
- g_clear_pointer (&tmp_supported_bm, g_array_unref);
|
||||
- g_clear_pointer (&tmp_supported_ds, g_array_unref);
|
||||
- g_clear_pointer (&tmp_supported_bfr, g_array_unref);
|
||||
g_propagate_error (error, inner_error);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (supported_mode)
|
||||
- *supported_mode = tmp_supported_mode;
|
||||
+ *supported_mode = g_steal_pointer (&tmp_supported_mode);
|
||||
if (supported_mt)
|
||||
- *supported_mt = tmp_supported_mt;
|
||||
+ *supported_mt = g_steal_pointer (&tmp_supported_mt);
|
||||
if (supported_bm)
|
||||
- *supported_bm = tmp_supported_bm;
|
||||
+ *supported_bm = g_steal_pointer (&tmp_supported_bm);
|
||||
if (supported_ds)
|
||||
- *supported_ds = tmp_supported_ds;
|
||||
+ *supported_ds = g_steal_pointer (&tmp_supported_ds);
|
||||
if (supported_bfr)
|
||||
- *supported_bfr = tmp_supported_bfr;
|
||||
+ *supported_bfr = g_steal_pointer (&tmp_supported_bfr);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
--
|
||||
GitLab
|
||||
156
backport-modem-helpers-rework-CGCONTRDP-response-parser.patch
Normal file
156
backport-modem-helpers-rework-CGCONTRDP-response-parser.patch
Normal file
@ -0,0 +1,156 @@
|
||||
From 845667c7b3d36f0e776d5a0e582ad62d48cdeb02 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksander Morgado <aleksandermj@chromium.org>
|
||||
Date: Wed, 24 Aug 2022 16:41:36 +0000
|
||||
Subject: [PATCH] modem-helpers: rework +CGCONTRDP response parser
|
||||
|
||||
We setup all output variables with g_autofree and then use
|
||||
g_steal_pointer() to return the needed ones.
|
||||
---
|
||||
src/mm-modem-helpers.c | 87 +++++++++++++++---------------------------
|
||||
1 file changed, 31 insertions(+), 56 deletions(-)
|
||||
|
||||
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
|
||||
index 58207bb15..9c3b0ccdc 100644
|
||||
--- a/src/mm-modem-helpers.c
|
||||
+++ b/src/mm-modem-helpers.c
|
||||
@@ -2335,13 +2335,13 @@ mm_3gpp_parse_cgcontrdp_response (const gchar *response,
|
||||
GError *inner_error = NULL;
|
||||
guint cid = 0;
|
||||
guint bearer_id = 0;
|
||||
- gchar *apn = NULL;
|
||||
- gchar *local_address_and_subnet = NULL;
|
||||
- gchar *local_address = NULL;
|
||||
- gchar *subnet = NULL;
|
||||
- gchar *gateway_address = NULL;
|
||||
- gchar *dns_primary_address = NULL;
|
||||
- gchar *dns_secondary_address = NULL;
|
||||
+ g_autofree gchar *apn = NULL;
|
||||
+ g_autofree gchar *local_address_and_subnet = NULL;
|
||||
+ g_autofree gchar *local_address = NULL;
|
||||
+ g_autofree gchar *subnet = NULL;
|
||||
+ g_autofree gchar *gateway_address = NULL;
|
||||
+ g_autofree gchar *dns_primary_address = NULL;
|
||||
+ g_autofree gchar *dns_secondary_address = NULL;
|
||||
guint field_format_extra_index = 0;
|
||||
|
||||
/* Response may be e.g.:
|
||||
@@ -2371,28 +2371,28 @@ mm_3gpp_parse_cgcontrdp_response (const gchar *response,
|
||||
g_assert (r != NULL);
|
||||
|
||||
g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error);
|
||||
- if (inner_error)
|
||||
- goto out;
|
||||
+ if (inner_error) {
|
||||
+ g_propagate_error (error, inner_error);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
|
||||
if (!g_match_info_matches (match_info)) {
|
||||
- inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Couldn't match +CGCONTRDP response");
|
||||
- goto out;
|
||||
+ g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Couldn't match +CGCONTRDP response");
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
if (out_cid && !mm_get_uint_from_match_info (match_info, 1, &cid)) {
|
||||
- inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing cid");
|
||||
- goto out;
|
||||
+ g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing cid");
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
if (out_bearer_id && !mm_get_uint_from_match_info (match_info, 2, &bearer_id)) {
|
||||
- inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing bearer id");
|
||||
- goto out;
|
||||
+ g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing bearer id");
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
/* Remaining strings are optional or empty allowed */
|
||||
-
|
||||
- if (out_apn)
|
||||
- apn = mm_get_string_unquoted_from_match_info (match_info, 3);
|
||||
+ apn = mm_get_string_unquoted_from_match_info (match_info, 3);
|
||||
|
||||
/*
|
||||
* The +CGCONTRDP=[cid] response format before version TS 27.007 v9.4.0 had
|
||||
@@ -2400,64 +2400,39 @@ mm_3gpp_parse_cgcontrdp_response (const gchar *response,
|
||||
*/
|
||||
local_address_and_subnet = mm_get_string_unquoted_from_match_info (match_info, 4);
|
||||
if (local_address_and_subnet && !split_local_address_and_subnet (local_address_and_subnet, &local_address, &subnet)) {
|
||||
- inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing local address and subnet");
|
||||
- goto out;
|
||||
+ g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing local address and subnet");
|
||||
+ return FALSE;
|
||||
}
|
||||
+
|
||||
/* If we don't have a subnet in field 4, we're using the old format with subnet in an extra field */
|
||||
if (!subnet) {
|
||||
- if (out_subnet)
|
||||
- subnet = mm_get_string_unquoted_from_match_info (match_info, 5);
|
||||
+ subnet = mm_get_string_unquoted_from_match_info (match_info, 5);
|
||||
field_format_extra_index = 1;
|
||||
}
|
||||
|
||||
- if (out_gateway_address)
|
||||
- gateway_address = mm_get_string_unquoted_from_match_info (match_info, 5 + field_format_extra_index);
|
||||
-
|
||||
- if (out_dns_primary_address)
|
||||
- dns_primary_address = mm_get_string_unquoted_from_match_info (match_info, 6 + field_format_extra_index);
|
||||
-
|
||||
- if (out_dns_secondary_address)
|
||||
- dns_secondary_address = mm_get_string_unquoted_from_match_info (match_info, 7 + field_format_extra_index);
|
||||
-
|
||||
-out:
|
||||
- g_free (local_address_and_subnet);
|
||||
-
|
||||
- if (inner_error) {
|
||||
- g_free (apn);
|
||||
- g_free (local_address);
|
||||
- g_free (subnet);
|
||||
- g_free (gateway_address);
|
||||
- g_free (dns_primary_address);
|
||||
- g_free (dns_secondary_address);
|
||||
- g_propagate_error (error, inner_error);
|
||||
- return FALSE;
|
||||
- }
|
||||
+ gateway_address = mm_get_string_unquoted_from_match_info (match_info, 5 + field_format_extra_index);
|
||||
+ dns_primary_address = mm_get_string_unquoted_from_match_info (match_info, 6 + field_format_extra_index);
|
||||
+ dns_secondary_address = mm_get_string_unquoted_from_match_info (match_info, 7 + field_format_extra_index);
|
||||
|
||||
if (out_cid)
|
||||
*out_cid = cid;
|
||||
if (out_bearer_id)
|
||||
*out_bearer_id = bearer_id;
|
||||
if (out_apn)
|
||||
- *out_apn = apn;
|
||||
-
|
||||
+ *out_apn = g_steal_pointer (&apn);
|
||||
/* Local address and subnet may always be retrieved, even if not requested
|
||||
* by the caller, as we need them to know which +CGCONTRDP=[cid] response is
|
||||
* being parsed. So make sure we free them if not needed. */
|
||||
if (out_local_address)
|
||||
- *out_local_address = local_address;
|
||||
- else
|
||||
- g_free (local_address);
|
||||
+ *out_local_address = g_steal_pointer (&local_address);
|
||||
if (out_subnet)
|
||||
- *out_subnet = subnet;
|
||||
- else
|
||||
- g_free (subnet);
|
||||
-
|
||||
+ *out_subnet = g_steal_pointer (&subnet);
|
||||
if (out_gateway_address)
|
||||
- *out_gateway_address = gateway_address;
|
||||
+ *out_gateway_address = g_steal_pointer (&gateway_address);
|
||||
if (out_dns_primary_address)
|
||||
- *out_dns_primary_address = dns_primary_address;
|
||||
+ *out_dns_primary_address = g_steal_pointer (&dns_primary_address);
|
||||
if (out_dns_secondary_address)
|
||||
- *out_dns_secondary_address = dns_secondary_address;
|
||||
+ *out_dns_secondary_address = g_steal_pointer (&dns_secondary_address);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
--
|
||||
GitLab
|
||||
@ -0,0 +1,86 @@
|
||||
From 9bbc768666e8ca77abdda325c46588cbf8a4df64 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksander Morgado <aleksandermj@chromium.org>
|
||||
Date: Wed, 24 Aug 2022 16:50:34 +0000
|
||||
Subject: [PATCH] modem-helpers: rework the +CGEV indication parser
|
||||
|
||||
We setup all output variables with g_autofree and then use
|
||||
g_steal_pointer() to return the needed ones.
|
||||
---
|
||||
src/mm-modem-helpers.c | 36 +++++++++++++++---------------------
|
||||
1 file changed, 15 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
|
||||
index 9c3b0ccdc..d71e1082c 100644
|
||||
--- a/src/mm-modem-helpers.c
|
||||
+++ b/src/mm-modem-helpers.c
|
||||
@@ -3642,8 +3642,8 @@ mm_3gpp_parse_cgev_indication_pdp (const gchar *str,
|
||||
g_autoptr(GRegex) r = NULL;
|
||||
g_autoptr(GMatchInfo) match_info = NULL;
|
||||
GError *inner_error = NULL;
|
||||
- gchar *pdp_type = NULL;
|
||||
- gchar *pdp_addr = NULL;
|
||||
+ g_autofree gchar *pdp_type = NULL;
|
||||
+ g_autofree gchar *pdp_addr = NULL;
|
||||
guint cid = 0;
|
||||
|
||||
g_assert (type == MM_3GPP_CGEV_REJECT ||
|
||||
@@ -3660,44 +3660,38 @@ mm_3gpp_parse_cgev_indication_pdp (const gchar *str,
|
||||
|
||||
str = mm_strip_tag (str, "+CGEV:");
|
||||
g_regex_match_full (r, str, strlen (str), 0, 0, &match_info, &inner_error);
|
||||
- if (inner_error)
|
||||
- goto out;
|
||||
+ if (inner_error) {
|
||||
+ g_propagate_error (error, inner_error);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
|
||||
if (!g_match_info_matches (match_info)) {
|
||||
- inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't match response");
|
||||
- goto out;
|
||||
+ g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't match response");
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
if (out_pdp_type && !(pdp_type = mm_get_string_unquoted_from_match_info (match_info, 1))) {
|
||||
- inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing PDP type");
|
||||
- goto out;
|
||||
+ g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing PDP type");
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
if (out_pdp_addr && !(pdp_addr = mm_get_string_unquoted_from_match_info (match_info, 2))) {
|
||||
- inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing PDP addr");
|
||||
- goto out;
|
||||
+ g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing PDP addr");
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
/* CID is optional */
|
||||
if (out_cid &&
|
||||
(g_match_info_get_match_count (match_info) >= 4) &&
|
||||
!mm_get_uint_from_match_info (match_info, 3, &cid)) {
|
||||
- inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing CID");
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
-out:
|
||||
- if (inner_error) {
|
||||
- g_free (pdp_type);
|
||||
- g_free (pdp_addr);
|
||||
- g_propagate_error (error, inner_error);
|
||||
+ g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing CID");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (out_pdp_type)
|
||||
- *out_pdp_type = pdp_type;
|
||||
+ *out_pdp_type = g_steal_pointer (&pdp_type);
|
||||
if (out_pdp_addr)
|
||||
- *out_pdp_addr = pdp_addr;
|
||||
+ *out_pdp_addr = g_steal_pointer (&pdp_addr);
|
||||
if (out_cid)
|
||||
*out_cid = cid;
|
||||
return TRUE;
|
||||
--
|
||||
GitLab
|
||||
@ -0,0 +1,115 @@
|
||||
From 8eeaba188272de496671763bc31f7fd592cb5ce0 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksander Morgado <aleksandermj@chromium.org>
|
||||
Date: Wed, 24 Aug 2022 16:55:41 +0000
|
||||
Subject: [PATCH] modem-helpers-ublox: rework +UIPADDR response parser
|
||||
|
||||
We setup all output variables with g_autofree and then use
|
||||
g_steal_pointer() to return the needed ones.
|
||||
---
|
||||
plugins/ublox/mm-modem-helpers-ublox.c | 65 ++++++++++----------------
|
||||
1 file changed, 24 insertions(+), 41 deletions(-)
|
||||
|
||||
diff --git a/plugins/ublox/mm-modem-helpers-ublox.c b/plugins/ublox/mm-modem-helpers-ublox.c
|
||||
index 5cc035422..84a7cf272 100644
|
||||
--- a/plugins/ublox/mm-modem-helpers-ublox.c
|
||||
+++ b/plugins/ublox/mm-modem-helpers-ublox.c
|
||||
@@ -228,11 +228,11 @@ mm_ublox_parse_uipaddr_response (const gchar *response,
|
||||
g_autoptr(GMatchInfo) match_info = NULL;
|
||||
GError *inner_error = NULL;
|
||||
guint cid = 0;
|
||||
- gchar *if_name = NULL;
|
||||
- gchar *ipv4_address = NULL;
|
||||
- gchar *ipv4_subnet = NULL;
|
||||
- gchar *ipv6_global_address = NULL;
|
||||
- gchar *ipv6_link_local_address = NULL;
|
||||
+ g_autofree gchar *if_name = NULL;
|
||||
+ g_autofree gchar *ipv4_address = NULL;
|
||||
+ g_autofree gchar *ipv4_subnet = NULL;
|
||||
+ g_autofree gchar *ipv6_global_address = NULL;
|
||||
+ g_autofree gchar *ipv6_link_local_address = NULL;
|
||||
|
||||
/* Response may be e.g.:
|
||||
* +UIPADDR: 1,"ccinet0","5.168.120.13","255.255.255.0","",""
|
||||
@@ -245,61 +245,44 @@ mm_ublox_parse_uipaddr_response (const gchar *response,
|
||||
g_assert (r != NULL);
|
||||
|
||||
g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error);
|
||||
- if (inner_error)
|
||||
- goto out;
|
||||
+ if (inner_error) {
|
||||
+ g_propagate_error (error, inner_error);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
|
||||
if (!g_match_info_matches (match_info)) {
|
||||
- inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Couldn't match +UIPADDR response");
|
||||
- goto out;
|
||||
+ g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Couldn't match +UIPADDR response");
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
if (out_cid && !mm_get_uint_from_match_info (match_info, 1, &cid)) {
|
||||
- inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing cid");
|
||||
- goto out;
|
||||
+ g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing cid");
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
if (out_if_name && !(if_name = mm_get_string_unquoted_from_match_info (match_info, 2))) {
|
||||
- inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing interface name");
|
||||
- goto out;
|
||||
+ g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing interface name");
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
/* Remaining strings are optional */
|
||||
-
|
||||
- if (out_ipv4_address)
|
||||
- ipv4_address = mm_get_string_unquoted_from_match_info (match_info, 3);
|
||||
-
|
||||
- if (out_ipv4_subnet)
|
||||
- ipv4_subnet = mm_get_string_unquoted_from_match_info (match_info, 4);
|
||||
-
|
||||
- if (out_ipv6_global_address)
|
||||
- ipv6_global_address = mm_get_string_unquoted_from_match_info (match_info, 5);
|
||||
-
|
||||
- if (out_ipv6_link_local_address)
|
||||
- ipv6_link_local_address = mm_get_string_unquoted_from_match_info (match_info, 6);
|
||||
-
|
||||
-out:
|
||||
- if (inner_error) {
|
||||
- g_free (if_name);
|
||||
- g_free (ipv4_address);
|
||||
- g_free (ipv4_subnet);
|
||||
- g_free (ipv6_global_address);
|
||||
- g_free (ipv6_link_local_address);
|
||||
- g_propagate_error (error, inner_error);
|
||||
- return FALSE;
|
||||
- }
|
||||
+ ipv4_address = mm_get_string_unquoted_from_match_info (match_info, 3);
|
||||
+ ipv4_subnet = mm_get_string_unquoted_from_match_info (match_info, 4);
|
||||
+ ipv6_global_address = mm_get_string_unquoted_from_match_info (match_info, 5);
|
||||
+ ipv6_link_local_address = mm_get_string_unquoted_from_match_info (match_info, 6);
|
||||
|
||||
if (out_cid)
|
||||
*out_cid = cid;
|
||||
if (out_if_name)
|
||||
- *out_if_name = if_name;
|
||||
+ *out_if_name = g_steal_pointer (&if_name);
|
||||
if (out_ipv4_address)
|
||||
- *out_ipv4_address = ipv4_address;
|
||||
+ *out_ipv4_address = g_steal_pointer (&ipv4_address);
|
||||
if (out_ipv4_subnet)
|
||||
- *out_ipv4_subnet = ipv4_subnet;
|
||||
+ *out_ipv4_subnet = g_steal_pointer (&ipv4_subnet);
|
||||
if (out_ipv6_global_address)
|
||||
- *out_ipv6_global_address = ipv6_global_address;
|
||||
+ *out_ipv6_global_address = g_steal_pointer (&ipv6_global_address);
|
||||
if (out_ipv6_link_local_address)
|
||||
- *out_ipv6_link_local_address = ipv6_link_local_address;
|
||||
+ *out_ipv6_link_local_address = g_steal_pointer (&ipv6_link_local_address);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
--
|
||||
GitLab
|
||||
@ -0,0 +1,52 @@
|
||||
From ff7e062e94fb779cae18be33d8d81f888033c98a Mon Sep 17 00:00:00 2001
|
||||
From: Aleksander Morgado <aleksandermj@chromium.org>
|
||||
Date: Wed, 24 Aug 2022 13:51:12 +0000
|
||||
Subject: [PATCH] mtk: fix task completion when loading supported modes
|
||||
|
||||
---
|
||||
plugins/mtk/mm-broadband-modem-mtk.c | 23 ++++++++++-------------
|
||||
1 file changed, 10 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/plugins/mtk/mm-broadband-modem-mtk.c b/plugins/mtk/mm-broadband-modem-mtk.c
|
||||
index 131f8daa4..0ceca795f 100644
|
||||
--- a/plugins/mtk/mm-broadband-modem-mtk.c
|
||||
+++ b/plugins/mtk/mm-broadband-modem-mtk.c
|
||||
@@ -199,14 +199,12 @@ get_supported_modes_ready (MMBaseModem *self,
|
||||
g_assert (r != NULL);
|
||||
|
||||
if (!g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &match_error)) {
|
||||
- if (match_error) {
|
||||
- g_propagate_error (&error, match_error);
|
||||
- } else {
|
||||
- g_set_error (&error,
|
||||
- MM_CORE_ERROR,
|
||||
- MM_CORE_ERROR_FAILED,
|
||||
- "Failed to match EGMR response: %s", response);
|
||||
- }
|
||||
+ if (match_error)
|
||||
+ g_task_return_error (task, error);
|
||||
+ else
|
||||
+ g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
|
||||
+ "Failed to match EGMR response: %s", response);
|
||||
+ g_object_unref (task);
|
||||
|
||||
g_match_info_free (match_info);
|
||||
g_regex_unref (r);
|
||||
@@ -214,11 +212,10 @@ get_supported_modes_ready (MMBaseModem *self,
|
||||
}
|
||||
|
||||
if (!mm_get_int_from_match_info (match_info, 1, &device_type)) {
|
||||
- g_set_error (&error,
|
||||
- MM_CORE_ERROR,
|
||||
- MM_CORE_ERROR_FAILED,
|
||||
- "Failed to parse the allowed mode response: '%s'",
|
||||
- response);
|
||||
+ g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
|
||||
+ "Failed to parse the allowed mode response: '%s'",
|
||||
+ response);
|
||||
+ g_object_unref (task);
|
||||
|
||||
g_regex_unref (r);
|
||||
g_match_info_free (match_info);
|
||||
--
|
||||
GitLab
|
||||
33
backport-serial-parsers-fix-invalid-EXZ-error-parser.patch
Normal file
33
backport-serial-parsers-fix-invalid-EXZ-error-parser.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From 79a5a4eed2189ea87d25cbe00bc824a2572cad66 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksander Morgado <aleksandermj@chromium.org>
|
||||
Date: Thu, 1 Sep 2022 15:00:03 +0200
|
||||
Subject: [PATCH] serial-parsers: fix invalid EXZ error parser
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Passed undetected when glib2 was using pcre1, it triggers an error now
|
||||
with pcre2.
|
||||
|
||||
See https://gitlab.gnome.org/GNOME/glib/-/issues/2729#note_1542038
|
||||
|
||||
Reported and fix suggested by: Marco Trevisan (Trevi帽o) <mail@3v1n0.net>
|
||||
---
|
||||
src/mm-serial-parsers.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/mm-serial-parsers.c b/src/mm-serial-parsers.c
|
||||
index 0b60d607d..fd01537d7 100644
|
||||
--- a/src/mm-serial-parsers.c
|
||||
+++ b/src/mm-serial-parsers.c
|
||||
@@ -115,7 +115,7 @@ mm_serial_parser_v1_new (void)
|
||||
parser->regex_cms_error = g_regex_new ("\\r\\n\\+CMS ERROR:\\s*(\\d+)\\r\\n$", flags, 0, NULL);
|
||||
parser->regex_cme_error_str = g_regex_new ("\\r\\n\\+CME ERROR:\\s*([^\\n\\r]+)\\r\\n$", flags, 0, NULL);
|
||||
parser->regex_cms_error_str = g_regex_new ("\\r\\n\\+CMS ERROR:\\s*([^\\n\\r]+)\\r\\n$", flags, 0, NULL);
|
||||
- parser->regex_ezx_error = g_regex_new ("\\r\\n\\MODEM ERROR:\\s*(\\d+)\\r\\n$", flags, 0, NULL);
|
||||
+ parser->regex_ezx_error = g_regex_new ("\\r\\nMODEM ERROR:\\s*(\\d+)\\r\\n$", flags, 0, NULL);
|
||||
parser->regex_unknown_error = g_regex_new ("\\r\\n(ERROR)|(COMMAND NOT SUPPORT)\\r\\n$", flags, 0, NULL);
|
||||
parser->regex_connect_failed = g_regex_new ("\\r\\n(NO CARRIER)|(BUSY)|(NO ANSWER)|(NO DIALTONE)\\r\\n$", flags, 0, NULL);
|
||||
/* Samsung Z810 may reply "NA" to report a not-available error */
|
||||
--
|
||||
GitLab
|
||||
309
backport-sms-prevent-crash-if-date-is-out-of-range.patch
Normal file
309
backport-sms-prevent-crash-if-date-is-out-of-range.patch
Normal file
@ -0,0 +1,309 @@
|
||||
From ac243f94676695d88e861d225e98ec5bb3c2861e Mon Sep 17 00:00:00 2001
|
||||
From: Carlo Lobrano <c.lobrano@gmail.com>
|
||||
Date: Fri, 8 Apr 2022 11:46:11 +0200
|
||||
Subject: [PATCH] sms: prevent crash if date is out of range
|
||||
|
||||
g_date_time_new, and g_date_time_new_utc return NULL if inputs are out
|
||||
of range, and currently mm_new_iso8601_time passes the GDateTime created
|
||||
by those two functions to date_time_format_iso8601 without checking for
|
||||
NULL values, causing a g_date_time_format_iso8601 crash if PDU data is
|
||||
corrupted with wrong date.
|
||||
|
||||
To prevent this, mm_new_iso8601_time now can return NULL and set a new
|
||||
GError if GDateTime created by g_date_time_new is NULL.
|
||||
|
||||
Fixes #546
|
||||
---
|
||||
.../cinterion/mm-modem-helpers-cinterion.c | 7 +++--
|
||||
plugins/huawei/mm-modem-helpers-huawei.c | 19 ++++++++----
|
||||
plugins/icera/mm-broadband-modem-icera.c | 7 +++--
|
||||
plugins/novatel/mm-broadband-modem-novatel.c | 4 +--
|
||||
plugins/sierra/mm-broadband-modem-sierra.c | 2 +-
|
||||
src/mm-modem-helpers.c | 8 +++--
|
||||
src/mm-sms-part-3gpp.c | 30 ++++++++++++++-----
|
||||
7 files changed, 91 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/src/mm-common-helpers.c b/src/mm-common-helpers.c
|
||||
index b7883b265..085177b7b 100644
|
||||
--- a/src/mm-modem-helpers.c
|
||||
+++ b/src/mm-modem-helpers.c
|
||||
@@ -1769,7 +1769,8 @@ mm_new_iso8601_time (guint year,
|
||||
guint minute,
|
||||
guint second,
|
||||
gboolean have_offset,
|
||||
- gint offset_minutes)
|
||||
+ gint offset_minutes,
|
||||
+ GError **error)
|
||||
{
|
||||
GString *str;
|
||||
|
||||
diff --git a/libmm-glib/mm-common-helpers.h b/libmm-glib/mm-common-helpers.h
|
||||
index d444012c0..490f882da 100644
|
||||
--- a/src/mm-modem-helpers.h
|
||||
+++ b/src/mm-modem-helpers.h
|
||||
@@ -216,7 +216,8 @@ gchar *mm_new_iso8601_time (guint year,
|
||||
guint minute,
|
||||
guint second,
|
||||
gboolean have_offset,
|
||||
- gint offset_minutes);
|
||||
+ gint offset_minutes,
|
||||
+ GError **error);
|
||||
|
||||
GArray *mm_filter_supported_modes (const GArray *all,
|
||||
const GArray *supported_combinations,
|
||||
diff --git a/plugins/cinterion/mm-modem-helpers-cinterion.c b/plugins/cinterion/mm-modem-helpers-cinterion.c
|
||||
index f8cec8258..a75eb5304 100644
|
||||
--- a/plugins/cinterion/mm-modem-helpers-cinterion.c
|
||||
+++ b/plugins/cinterion/mm-modem-helpers-cinterion.c
|
||||
@@ -1201,6 +1201,7 @@ mm_cinterion_parse_ctzu_urc (GMatchInfo *match_info,
|
||||
MMNetworkTimezone **tzp,
|
||||
GError **error)
|
||||
{
|
||||
+ gboolean ret = TRUE;
|
||||
guint year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0, dst = 0;
|
||||
gint tz = 0;
|
||||
|
||||
@@ -1229,7 +1230,9 @@ mm_cinterion_parse_ctzu_urc (GMatchInfo *match_info,
|
||||
/* Return ISO-8601 format date/time string */
|
||||
*iso8601p = mm_new_iso8601_time (year, month, day, hour,
|
||||
minute, second,
|
||||
- TRUE, tz * 15);
|
||||
+ TRUE, tz * 15,
|
||||
+ error);
|
||||
+ ret = (*iso8601p != NULL);
|
||||
}
|
||||
|
||||
if (tzp) {
|
||||
@@ -1245,7 +1248,7 @@ mm_cinterion_parse_ctzu_urc (GMatchInfo *match_info,
|
||||
if (tzp && mm_get_uint_from_match_info (match_info, 8, &dst))
|
||||
mm_network_timezone_set_dst_offset (*tzp, dst * 60);
|
||||
|
||||
- return TRUE;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
diff --git a/plugins/huawei/mm-modem-helpers-huawei.c b/plugins/huawei/mm-modem-helpers-huawei.c
|
||||
index b85484183..3ded62379 100644
|
||||
--- a/plugins/huawei/mm-modem-helpers-huawei.c
|
||||
+++ b/plugins/huawei/mm-modem-helpers-huawei.c
|
||||
@@ -1228,6 +1228,9 @@ gboolean mm_huawei_parse_nwtime_response (const gchar *response,
|
||||
mm_get_uint_from_match_info (match_info, 6, &second) &&
|
||||
mm_get_int_from_match_info (match_info, 7, &tz) &&
|
||||
mm_get_uint_from_match_info (match_info, 8, &dt)) {
|
||||
+
|
||||
+ ret = TRUE;
|
||||
+
|
||||
/* adjust year */
|
||||
if (year < 100)
|
||||
year += 2000;
|
||||
@@ -1240,7 +1243,9 @@ gboolean mm_huawei_parse_nwtime_response (const gchar *response,
|
||||
/* Return ISO-8601 format date/time string */
|
||||
*iso8601p = mm_new_iso8601_time (year, month, day, hour,
|
||||
minute, second,
|
||||
- TRUE, (tz * 15) + (dt * 60));
|
||||
+ TRUE, (tz * 15) + (dt * 60),
|
||||
+ error);
|
||||
+ ret = (*iso8601p != NULL);
|
||||
}
|
||||
if (tzp) {
|
||||
*tzp = mm_network_timezone_new ();
|
||||
@@ -1248,7 +1253,6 @@ gboolean mm_huawei_parse_nwtime_response (const gchar *response,
|
||||
mm_network_timezone_set_dst_offset (*tzp, dt * 60);
|
||||
}
|
||||
|
||||
- ret = TRUE;
|
||||
} else {
|
||||
g_set_error_literal (error,
|
||||
MM_CORE_ERROR,
|
||||
@@ -1312,14 +1316,19 @@ gboolean mm_huawei_parse_time_response (const gchar *response,
|
||||
mm_get_uint_from_match_info (match_info, 4, &hour) &&
|
||||
mm_get_uint_from_match_info (match_info, 5, &minute) &&
|
||||
mm_get_uint_from_match_info (match_info, 6, &second)) {
|
||||
+ ret = TRUE;
|
||||
+
|
||||
/* adjust year */
|
||||
if (year < 100)
|
||||
year += 2000;
|
||||
+
|
||||
/* Return ISO-8601 format date/time string */
|
||||
- if (iso8601p)
|
||||
+ if (iso8601p) {
|
||||
*iso8601p = mm_new_iso8601_time (year, month, day, hour,
|
||||
- minute, second, FALSE, 0);
|
||||
- ret = TRUE;
|
||||
+ minute, second, FALSE, 0,
|
||||
+ error);
|
||||
+ ret = (*iso8601p != NULL);
|
||||
+ }
|
||||
} else {
|
||||
g_set_error_literal (error,
|
||||
MM_CORE_ERROR,
|
||||
diff --git a/plugins/icera/mm-broadband-modem-icera.c b/plugins/icera/mm-broadband-modem-icera.c
|
||||
index 26016c4c4..96cb45fa4 100644
|
||||
--- a/plugins/icera/mm-broadband-modem-icera.c
|
||||
+++ b/plugins/icera/mm-broadband-modem-icera.c
|
||||
@@ -1569,6 +1569,7 @@ parse_tlts_query_reply (const gchar *response,
|
||||
MMNetworkTimezone **tz,
|
||||
GError **error)
|
||||
{
|
||||
+ gboolean ret = TRUE;
|
||||
gint year;
|
||||
gint month;
|
||||
gint day;
|
||||
@@ -1649,11 +1650,13 @@ parse_tlts_query_reply (const gchar *response,
|
||||
g_date_time_get_minute (adjusted),
|
||||
g_date_time_get_second (adjusted),
|
||||
TRUE,
|
||||
- offset);
|
||||
+ offset,
|
||||
+ error);
|
||||
+ ret = (*iso8601 != NULL);
|
||||
}
|
||||
|
||||
g_date_time_unref (adjusted);
|
||||
- return TRUE;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static MMNetworkTimezone *
|
||||
diff --git a/plugins/novatel/mm-broadband-modem-novatel.c b/plugins/novatel/mm-broadband-modem-novatel.c
|
||||
index 4eba0e168..1cc88e906 100644
|
||||
--- a/plugins/novatel/mm-broadband-modem-novatel.c
|
||||
+++ b/plugins/novatel/mm-broadband-modem-novatel.c
|
||||
@@ -1431,13 +1431,13 @@ parse_nwltime_reply (const char *response,
|
||||
mm_get_int_from_match_info (match_info, 8, &utc_offset)) {
|
||||
|
||||
result = mm_new_iso8601_time (year, month, day, hour, minute, second,
|
||||
- TRUE, utc_offset * 60);
|
||||
+ TRUE, utc_offset * 60, error);
|
||||
if (out_tz) {
|
||||
*out_tz = mm_network_timezone_new ();
|
||||
mm_network_timezone_set_offset (*out_tz, utc_offset * 60);
|
||||
}
|
||||
|
||||
- success = TRUE;
|
||||
+ success = (result != NULL);
|
||||
} else {
|
||||
g_set_error_literal (error,
|
||||
MM_CORE_ERROR,
|
||||
diff --git a/plugins/sierra/mm-broadband-modem-sierra.c b/plugins/sierra/mm-broadband-modem-sierra.c
|
||||
index 518f8adbc..3ac20808f 100644
|
||||
--- a/plugins/sierra/mm-broadband-modem-sierra.c
|
||||
+++ b/plugins/sierra/mm-broadband-modem-sierra.c
|
||||
@@ -1656,7 +1656,7 @@ parse_time (const gchar *response,
|
||||
mm_get_uint_from_match_info (match_info, 4, &hour) &&
|
||||
mm_get_uint_from_match_info (match_info, 5, &minute) &&
|
||||
mm_get_uint_from_match_info (match_info, 6, &second)) {
|
||||
- result = mm_new_iso8601_time (year, month, day, hour, minute, second, FALSE, 0);
|
||||
+ result = mm_new_iso8601_time (year, month, day, hour, minute, second, FALSE, 0, error);
|
||||
} else {
|
||||
g_set_error (error,
|
||||
MM_CORE_ERROR,
|
||||
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
|
||||
index 72714ab9a..5e58ba9dd 100644
|
||||
--- a/src/mm-modem-helpers.c
|
||||
+++ b/src/mm-modem-helpers.c
|
||||
@@ -5112,15 +5112,17 @@ mm_parse_cclk_response (const char *response,
|
||||
mm_network_timezone_set_offset (*tzp, tz * 15);
|
||||
}
|
||||
|
||||
+ ret = TRUE;
|
||||
+
|
||||
if (iso8601p) {
|
||||
/* Return ISO-8601 format date/time string */
|
||||
*iso8601p = mm_new_iso8601_time (year, month, day, hour,
|
||||
minute, second,
|
||||
- TRUE, (tz * 15));
|
||||
+ TRUE, (tz * 15),
|
||||
+ error);
|
||||
+ ret = (*iso8601p != NULL);
|
||||
}
|
||||
|
||||
- ret = TRUE;
|
||||
-
|
||||
out:
|
||||
g_match_info_free (match_info);
|
||||
g_regex_unref (r);
|
||||
diff --git a/src/mm-sms-part-3gpp.c b/src/mm-sms-part-3gpp.c
|
||||
index bfae03a84..aeb9decb0 100644
|
||||
--- a/src/mm-sms-part-3gpp.c
|
||||
+++ b/src/mm-sms-part-3gpp.c
|
||||
@@ -161,7 +161,8 @@ sms_decode_address (const guint8 *address,
|
||||
}
|
||||
|
||||
static gchar *
|
||||
-sms_decode_timestamp (const guint8 *timestamp)
|
||||
+sms_decode_timestamp (const guint8 *timestamp,
|
||||
+ GError **error)
|
||||
{
|
||||
/* ISO8601 format: YYYY-MM-DDTHH:MM:SS+HHMM */
|
||||
guint year, month, day, hour, minute, second;
|
||||
@@ -179,7 +180,7 @@ sms_decode_timestamp (const guint8 *timestamp)
|
||||
offset_minutes = -1 * offset_minutes;
|
||||
|
||||
return mm_new_iso8601_time (year, month, day, hour,
|
||||
- minute, second, TRUE, offset_minutes);
|
||||
+ minute, second, TRUE, offset_minutes, error);
|
||||
}
|
||||
|
||||
static MMSmsEncoding
|
||||
@@ -509,6 +510,7 @@ mm_sms_part_3gpp_new_from_binary_pdu (guint index,
|
||||
/* Get timestamps and indexes for TP-PID, TP-DCS and TP-UDL/TP-UD */
|
||||
|
||||
if (pdu_type == SMS_TP_MTI_SMS_DELIVER) {
|
||||
+ gchar *str = NULL;
|
||||
PDU_SIZE_CHECK (offset + 9,
|
||||
"cannot read PID/DCS/Timestamp"); /* 1+1+7=9 */
|
||||
|
||||
@@ -519,8 +521,13 @@ mm_sms_part_3gpp_new_from_binary_pdu (guint index,
|
||||
tp_dcs_offset = offset++;
|
||||
|
||||
/* ------ Timestamp (7 bytes) ------ */
|
||||
+ str = sms_decode_timestamp (&pdu[offset], error);
|
||||
+ if (!str) {
|
||||
+ mm_sms_part_free (sms_part);
|
||||
+ return NULL;
|
||||
+ }
|
||||
mm_sms_part_take_timestamp (sms_part,
|
||||
- sms_decode_timestamp (&pdu[offset]));
|
||||
+ str);
|
||||
offset += 7;
|
||||
|
||||
tp_user_data_len_offset = offset;
|
||||
@@ -564,6 +571,7 @@ mm_sms_part_3gpp_new_from_binary_pdu (guint index,
|
||||
tp_user_data_len_offset = offset;
|
||||
}
|
||||
else if (pdu_type == SMS_TP_MTI_SMS_STATUS_REPORT) {
|
||||
+ gchar *str = NULL;
|
||||
/* We have 2 timestamps in status report PDUs:
|
||||
* first, the timestamp for when the PDU was received in the SMSC
|
||||
* second, the timestamp for when the PDU was forwarded by the SMSC
|
||||
@@ -571,13 +579,21 @@ mm_sms_part_3gpp_new_from_binary_pdu (guint index,
|
||||
PDU_SIZE_CHECK (offset + 15, "cannot read Timestamps/TP-STATUS"); /* 7+7+1=15 */
|
||||
|
||||
/* ------ Timestamp (7 bytes) ------ */
|
||||
- mm_sms_part_take_timestamp (sms_part,
|
||||
- sms_decode_timestamp (&pdu[offset]));
|
||||
+ str = sms_decode_timestamp (&pdu[offset], error);
|
||||
+ if (!str) {
|
||||
+ mm_sms_part_free (sms_part);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ mm_sms_part_take_timestamp (sms_part, str);
|
||||
offset += 7;
|
||||
|
||||
/* ------ Discharge Timestamp (7 bytes) ------ */
|
||||
- mm_sms_part_take_discharge_timestamp (sms_part,
|
||||
- sms_decode_timestamp (&pdu[offset]));
|
||||
+ str = sms_decode_timestamp (&pdu[offset], error);
|
||||
+ if (!str) {
|
||||
+ mm_sms_part_free (sms_part);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ mm_sms_part_take_discharge_timestamp (sms_part, str);
|
||||
offset += 7;
|
||||
|
||||
/* ----- TP-STATUS (1 byte) ------ */
|
||||
--
|
||||
GitLab
|
||||
@ -0,0 +1,64 @@
|
||||
From 68af7f28c0d3bb1088dc58b9e6408d9941c9614c Mon Sep 17 00:00:00 2001
|
||||
From: Aleksander Morgado <aleksandermj@chromium.org>
|
||||
Date: Fri, 2 Sep 2022 17:13:29 +0200
|
||||
Subject: [PATCH] test-modem-helpers: add EOL to strings matched with
|
||||
G_REGEX_NEWLINE_CRLF
|
||||
|
||||
Looks like pcre2 (used since glib 2.73.2) requires EOLs to match if
|
||||
G_REGEX_NEWLINE_CRLF is explicitly used. The tests are updated
|
||||
accordingly, because the modem responses will anyway have the EOLs
|
||||
as well.
|
||||
|
||||
See https://gitlab.gnome.org/GNOME/glib/-/issues/2729#note_1544130
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/601
|
||||
|
||||
(cherry picked from commit 51a333cd9a6707de7c623fd4c94cb6032477572f)
|
||||
---
|
||||
src/tests/test-modem-helpers.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/tests/test-modem-helpers.c b/src/tests/test-modem-helpers.c
|
||||
index dc22fbde7..d8cef0816 100644
|
||||
--- a/src/tests/test-modem-helpers.c
|
||||
+++ b/src/tests/test-modem-helpers.c
|
||||
@@ -4228,8 +4228,8 @@ typedef struct {
|
||||
} TestCcwa;
|
||||
|
||||
static TestCcwa test_ccwa[] = {
|
||||
- { "+CCWA: 0,255", FALSE, FALSE }, /* all disabled */
|
||||
- { "+CCWA: 1,255", TRUE, FALSE }, /* all enabled */
|
||||
+ { "+CCWA: 0,255\r\n", FALSE, FALSE }, /* all disabled */
|
||||
+ { "+CCWA: 1,255\r\n", TRUE, FALSE }, /* all enabled */
|
||||
{ "+CCWA: 0,1\r\n"
|
||||
"+CCWA: 0,4\r\n", FALSE, FALSE }, /* voice and fax disabled */
|
||||
{ "+CCWA: 1,1\r\n"
|
||||
@@ -4304,7 +4304,7 @@ common_test_clcc_response (const gchar *str,
|
||||
static void
|
||||
test_clcc_response_empty (void)
|
||||
{
|
||||
- const gchar *response = "";
|
||||
+ const gchar *response = "\r\n";
|
||||
|
||||
common_test_clcc_response (response, NULL, 0);
|
||||
}
|
||||
@@ -4317,7 +4317,7 @@ test_clcc_response_single (void)
|
||||
};
|
||||
|
||||
const gchar *response =
|
||||
- "+CLCC: 1,1,0,0,0,\"123456789\",161";
|
||||
+ "+CLCC: 1,1,0,0,0,\"123456789\",161\r\n";
|
||||
|
||||
common_test_clcc_response (response, expected_call_info_list, G_N_ELEMENTS (expected_call_info_list));
|
||||
}
|
||||
@@ -4331,7 +4331,7 @@ test_clcc_response_single_long (void)
|
||||
|
||||
/* NOTE: priority field is EMPTY */
|
||||
const gchar *response =
|
||||
- "+CLCC: 1,1,4,0,0,\"123456789\",129,\"\",,0";
|
||||
+ "+CLCC: 1,1,4,0,0,\"123456789\",129,\"\",,0\r\n";
|
||||
|
||||
common_test_clcc_response (response, expected_call_info_list, G_N_ELEMENTS (expected_call_info_list));
|
||||
}
|
||||
--
|
||||
GitLab
|
||||
Loading…
x
Reference in New Issue
Block a user