diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-11-10 11:39:14 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-11-11 06:44:26 -0800 |
commit | 28d9f05fa1593b252e98965c8a4c6c4c7c2cf4a7 (patch) | |
tree | c2b00e49fad721738503a274328c8a7e18723400 /src/plugins | |
parent | e76bcaa203a0b6845c84ed9bb4cf11c2f6396f54 (diff) |
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 <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platformthemes/gtk3/qgtk3theme.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<bool>("gtk-application-prefer-dark-theme"); + const auto preferDark = gtkSetting<gboolean>("gtk-application-prefer-dark-theme"); if (preferDark) return Qt::Appearance::Dark; |