qt5-qtbase/0012-Gtk3-fix-stack-smashing-on-mismatch-between-bool-and.patch
2023-08-21 19:29:04 +02:00

30 lines
1.2 KiB
Diff

From dc373fc0d7dc14107e06aca4b5664c830d681494 Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Wed, 26 Jul 2023 15:39:31 +0200
Subject: [PATCH 12/22] Gtk3: fix stack smashing on mismatch between bool and
gboolean
Glib is written in C and predates C99 (though not really, glib 2.0 was
released in 2002), so it defines gboolean as int, a 4-byte type. C++'s
bool is a 1-byte type, so this caused a buffer overflow.
---
src/plugins/platformthemes/gtk3/qgtk3theme.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/plugins/platformthemes/gtk3/qgtk3theme.cpp b/src/plugins/platformthemes/gtk3/qgtk3theme.cpp
index 8688fe205e..c01947e402 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3theme.cpp
+++ b/src/plugins/platformthemes/gtk3/qgtk3theme.cpp
@@ -210,7 +210,7 @@ Qt::Appearance QGtk3Theme::appearance() const
gtk-theme-name provides both light and dark variants. We can save a
regex check by testing this property first.
*/
- const auto preferDark = gtkSetting<bool>("gtk-application-prefer-dark-theme");
+ const auto preferDark = gtkSetting<gboolean>("gtk-application-prefer-dark-theme");
if (preferDark)
return Qt::Appearance::Dark;
--
2.41.0