From 28d9f05fa1593b252e98965c8a4c6c4c7c2cf4a7 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 10 Nov 2022 11:39:14 -0800 Subject: 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. Problem introduced in 2b77e779ce43386d14bdd2d1109ee182bcd0d047 ("QGtk3Theme: implement appearance function to detect dark themes"). Pick-to: 6.2 6.4 Change-Id: Ieba79baf5ac34264a988fffd172650701fa54da8 Reviewed-by: Shawn Rutledge --- src/plugins/platformthemes/gtk3/qgtk3theme.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platformthemes/gtk3/qgtk3theme.cpp b/src/plugins/platformthemes/gtk3/qgtk3theme.cpp index 313fd40b9f..11fd492f60 100644 --- a/src/plugins/platformthemes/gtk3/qgtk3theme.cpp +++ b/src/plugins/platformthemes/gtk3/qgtk3theme.cpp @@ -190,7 +190,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("gtk-application-prefer-dark-theme"); + const auto preferDark = gtkSetting("gtk-application-prefer-dark-theme"); if (preferDark) return Qt::Appearance::Dark; -- cgit v1.2.3