diff options
author | Riteo <riteo@posteo.net> | 2023-05-11 19:25:53 +0200 |
---|---|---|
committer | Riteo <riteo@posteo.net> | 2023-05-11 19:29:10 +0200 |
commit | a7542070ae5560aa0eb56260984da62cfb8fac08 (patch) | |
tree | 15ccc161f62cc259ffd89ce552d61c92255f5905 /platform/linuxbsd/freedesktop_portal_desktop.cpp | |
parent | fd4a06c51555904104b18494d0224f450d74fe2a (diff) | |
download | redot-engine-a7542070ae5560aa0eb56260984da62cfb8fac08.tar.gz |
Check DBus loading status before attempting to detect its version
Fixes two related segfaults caused by running the DBus version check
unconditionally and potentially calling null function pointers.
This was clearly an oversight as all the other wrappers have proper
loading status checks.
Diffstat (limited to 'platform/linuxbsd/freedesktop_portal_desktop.cpp')
-rw-r--r-- | platform/linuxbsd/freedesktop_portal_desktop.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/linuxbsd/freedesktop_portal_desktop.cpp b/platform/linuxbsd/freedesktop_portal_desktop.cpp index b45b7e676d..6dfa8ed93c 100644 --- a/platform/linuxbsd/freedesktop_portal_desktop.cpp +++ b/platform/linuxbsd/freedesktop_portal_desktop.cpp @@ -138,6 +138,11 @@ FreeDesktopPortalDesktop::FreeDesktopPortalDesktop() { #else unsupported = false; #endif + + if (unsupported) { + return; + } + bool ver_ok = false; int version_major = 0; int version_minor = 0; |