ModemManager/0006-port-qmi-fix-array-bound-check.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

27 lines
963 B
Diff

From 02d893f8abaffa51ad61b0bb6ce67f55de5cd217 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Sun, 26 May 2024 23:54:50 +0200
Subject: [PATCH 06/11] port-qmi: fix array bound check
There's an off-by-one error.
---
src/mm-port-qmi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mm-port-qmi.c b/src/mm-port-qmi.c
index f3c64464a..38703bc20 100644
--- a/src/mm-port-qmi.c
+++ b/src/mm-port-qmi.c
@@ -1641,7 +1641,7 @@ check_data_format_combination (GTask *task)
/* go on to the next supported combination */
for (++ctx->data_format_combination_i;
- ctx->data_format_combination_i <= (gint)G_N_ELEMENTS (data_format_combinations);
+ ctx->data_format_combination_i < (gint)G_N_ELEMENTS (data_format_combinations);
ctx->data_format_combination_i++) {
const DataFormatCombination *combination;
g_autofree gchar *kernel_data_mode_str = NULL;
--
2.45.2