소스 검색

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.
Riteo 2 년 전
부모
커밋
a7542070ae
2개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      platform/linuxbsd/freedesktop_portal_desktop.cpp
  2. 5 0
      platform/linuxbsd/freedesktop_screensaver.cpp

+ 5 - 0
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;

+ 5 - 0
platform/linuxbsd/freedesktop_screensaver.cpp

@@ -141,6 +141,11 @@ FreeDesktopScreenSaver::FreeDesktopScreenSaver() {
 #else
 	unsupported = false;
 #endif
+
+	if (unsupported) {
+		return;
+	}
+
 	bool ver_ok = false;
 	int version_major = 0;
 	int version_minor = 0;