ModemManager/0002-ublox-helpers-fix-propagation-of-URAT-response-parse.patch
Lubomir Rintel 471d385cd1 Add patches for a couple of bugs that make static analysis unhappy
Real bugs, but no security implications. Let's check the boxes and fix
them, to reduce the static analysis tooling noise.

Resolves: https://issues.redhat.com/browse/RHEL-38991
2024-06-25 10:52:15 +02:00

39 lines
1.2 KiB
Diff

From d550a24ffdae4492e9f9e18fdf294adcda28fb65 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Thu, 23 May 2024 14:45:22 +0200
Subject: [PATCH 02/11] ublox/helpers: fix propagation of +URAT response parse
error
We have been constructing a GError too late, just leaking it instead of
propagating.
---
src/plugins/ublox/mm-modem-helpers-ublox.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/plugins/ublox/mm-modem-helpers-ublox.c b/src/plugins/ublox/mm-modem-helpers-ublox.c
index 0fd1c5b0b..ffb1374de 100644
--- a/src/plugins/ublox/mm-modem-helpers-ublox.c
+++ b/src/plugins/ublox/mm-modem-helpers-ublox.c
@@ -1813,14 +1813,13 @@ mm_ublox_parse_urat_read_response (const gchar *response,
}
out:
- if (inner_error) {
- g_propagate_error (error, inner_error);
- return FALSE;
- }
-
if (allowed == MM_MODEM_MODE_NONE) {
inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
"Couldn't parse +URAT response: %s", response);
+ }
+
+ if (inner_error) {
+ g_propagate_error (error, inner_error);
return FALSE;
}
--
2.45.2