Fix various openscan issues

Resolves: RHEL-38648
This commit is contained in:
Christian Hergert 2024-06-12 16:09:11 -07:00
parent b707ce6d8e
commit 4e821a174a
3 changed files with 103 additions and 0 deletions

View File

@ -14,6 +14,9 @@ License: LGPL-2.1-or-later AND MIT
URL: https://gitlab.gnome.org/GNOME/libadwaita URL: https://gitlab.gnome.org/GNOME/libadwaita
Source0: https://download.gnome.org/sources/%{name}/1.5/%{name}-%{tarball_version}.tar.xz Source0: https://download.gnome.org/sources/%{name}/1.5/%{name}-%{tarball_version}.tar.xz
Patch0: mismatched-va_args.patch
Patch1: plug-cond_1-leak.patch
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
BuildRequires: gcc BuildRequires: gcc
BuildRequires: gettext BuildRequires: gettext

52
mismatched-va_args.patch Normal file
View File

@ -0,0 +1,52 @@
From a717b3ee38bdf348ede2992de6b2345200f4f468 Mon Sep 17 00:00:00 2001
From: Christian Hergert <chergert@redhat.com>
Date: Wed, 12 Jun 2024 15:48:06 -0700
Subject: [PATCH] va_args: fix umatched va_start()
va_list on some architectures require a va_end() to restore state which
may have been spilled. In this case it is easier to just avoid calling
va_start() altogether.
---
src/adw-alert-dialog.c | 4 ++--
src/adw-message-dialog.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/adw-alert-dialog.c b/src/adw-alert-dialog.c
index 7c002a4a..48d5d773 100644
--- a/src/adw-alert-dialog.c
+++ b/src/adw-alert-dialog.c
@@ -1784,11 +1784,11 @@ adw_alert_dialog_add_responses (AdwAlertDialog *self,
g_return_if_fail (ADW_IS_ALERT_DIALOG (self));
- va_start (args, first_id);
-
if (!first_id)
return;
+ va_start (args, first_id);
+
id = first_id;
label = va_arg (args, const char *);
diff --git a/src/adw-message-dialog.c b/src/adw-message-dialog.c
index cb3d3548..e36876fd 100644
--- a/src/adw-message-dialog.c
+++ b/src/adw-message-dialog.c
@@ -1917,11 +1917,11 @@ adw_message_dialog_add_responses (AdwMessageDialog *self,
g_return_if_fail (ADW_IS_MESSAGE_DIALOG (self));
- va_start (args, first_id);
-
if (!first_id)
return;
+ va_start (args, first_id);
+
id = first_id;
label = va_arg (args, const char *);
--
2.45.1

48
plug-cond_1-leak.patch Normal file
View File

@ -0,0 +1,48 @@
From 3b9f98fb670b97911fc0d307d22cbf87e6ad27e6 Mon Sep 17 00:00:00 2001
From: Christian Hergert <chergert@redhat.com>
Date: Wed, 12 Jun 2024 16:03:12 -0700
Subject: [PATCH] breakpoint: plug leak of cond_1 in failure paths
---
src/adw-breakpoint.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/adw-breakpoint.c b/src/adw-breakpoint.c
index 3d69420c4..eb2710ea3 100644
--- a/src/adw-breakpoint.c
+++ b/src/adw-breakpoint.c
@@ -642,6 +642,7 @@ parse_multi (const char *str,
return cond_1;
} else {
*error = CONDITION_PARSER_ERROR_UNKNOWN_OPERATOR;
+ g_clear_pointer (&cond_1, adw_breakpoint_condition_free);
return NULL;
}
@@ -650,6 +651,7 @@ parse_multi (const char *str,
} else {
*endp = (char *) str;
*error = CONDITION_PARSER_ERROR_UNEXPECTED_CHARACTER;
+ g_clear_pointer (&cond_1, adw_breakpoint_condition_free);
return NULL;
}
@@ -663,6 +665,7 @@ parse_multi (const char *str,
if (!cond_2) {
*endp = (char *) str;
+ g_clear_pointer (&cond_1, adw_breakpoint_condition_free);
return NULL;
}
@@ -679,6 +682,7 @@ parse_multi (const char *str,
if (!cond_2) {
*endp = (char *) str;
+ g_clear_pointer (&cond_1, adw_breakpoint_condition_free);
return NULL;
}
--
GitLab