aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Berhoerster <guido+freiesoftware@berhoerster.name>2024-03-04 14:55:44 +0100
committerGuido Berhoerster <guido+freiesoftware@berhoerster.name>2024-03-04 14:55:44 +0100
commit21967eef1aedb046f7260c3fc58e0b046908d793 (patch)
tree27670622b2d80c39e9543cf57a98f80ee6399eb6
parent1e797106dafc30c4e6db65bbc2783d8ac0fc8c68 (diff)
downloadayatana-indicator-display-21967eef1aedb046f7260c3fc58e0b046908d793.tar.gz
ayatana-indicator-display-21967eef1aedb046f7260c3fc58e0b046908d793.tar.bz2
ayatana-indicator-display-21967eef1aedb046f7260c3fc58e0b046908d793.zip
Fix access of unitialized variables in DisplayIndicator destructor
In the constructor nGreeterSubscription and pConnection are only initialized if bGreeter is true whereas the destructor always accesses them and possibly passes uninitialized values to functions.
-rw-r--r--src/service.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/service.cpp b/src/service.cpp
index f3fd33b..a8d6839 100644
--- a/src/service.cpp
+++ b/src/service.cpp
@@ -1141,8 +1141,8 @@ private:
GSettings *pMetacitySettings = NULL;
GSettings *pColorSchemeSettings = NULL;
gboolean bTest;
- guint nGreeterSubscription;
- GDBusConnection *pConnection;
+ guint nGreeterSubscription = 0;
+ GDBusConnection *pConnection = NULL;
gchar *sUser = NULL;
GSList *lUsers = NULL;
gboolean bReadingAccountsService = FALSE;