[Libreoffice-commits] core.git: vcl/unx
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sun Dec 23 01:06:40 UTC 2018
vcl/unx/generic/printer/cpdmgr.cxx | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit 87d90b6e60659e9c976daa9692ae99ec87a6978c
Author: Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Sun Dec 23 00:59:55 2018 +0100
Commit: Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Sun Dec 23 02:06:17 2018 +0100
tdf#122116 Only create CPDManager if D-Bus descriptions present
Since the XML files are required in the
'onNameAcquired()' method, check for their existence
before returning a CPDManager pointer in
'tryLoadCPD()', to avoid returning a CPDManager
that is unusable (and will even lead to a crash).
Change-Id: I83c493ba8bd775ea398111971cbecb9352050194
Reviewed-on: https://gerrit.libreoffice.org/65576
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>
diff --git a/vcl/unx/generic/printer/cpdmgr.cxx b/vcl/unx/generic/printer/cpdmgr.cxx
index c79ed672db60..195708d1953b 100644
--- a/vcl/unx/generic/printer/cpdmgr.cxx
+++ b/vcl/unx/generic/printer/cpdmgr.cxx
@@ -250,6 +250,12 @@ CPDManager* CPDManager::tryLoadCPD()
static const char* pEnv = getenv("SAL_DISABLE_CPD");
if (!pEnv || !*pEnv) {
+ // interface description XML files are needed in 'onNameAcquired()'
+ if (!g_file_test(FRONTEND_INTERFACE, G_FILE_TEST_IS_REGULAR) ||
+ !g_file_test(BACKEND_INTERFACE, G_FILE_TEST_IS_REGULAR)) {
+ return nullptr;
+ }
+
GDir *dir;
const gchar *filename;
dir = g_dir_open(BACKEND_DIR, 0, nullptr);
More information about the Libreoffice-commits
mailing list