[gdm] Fix uses of uninitialized memory
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] Fix uses of uninitialized memory
- Date: Thu, 16 Aug 2012 19:40:01 +0000 (UTC)
commit 9dd54ca944dd6c37b1465b53bae75b32fef2bb39
Author: Stef Walter <stefw gnome org>
Date: Thu Aug 16 10:21:47 2012 +0200
Fix uses of uninitialized memory
* Most setters of a **error (such as g_set_error()
and g_propagate_error() require and check that the
GError pointer is NULL before setting).
* Fix cases where a GError pointer was not initialized
to NULL, and instead relied on the stack value that
happened to be present.
https://bugzilla.gnome.org/show_bug.cgi?id=681972
daemon/gdm-display.c | 6 +++---
daemon/gdm-slave.c | 2 +-
gui/libgdm/gdm-client.c | 8 ++++----
.../extensions/smartcard/gdm-smartcard-manager.c | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
index 6e010ff..5db63cd 100644
--- a/daemon/gdm-display.c
+++ b/daemon/gdm-display.c
@@ -1195,7 +1195,7 @@ handle_set_slave_bus_name (GdmDBusDisplay *skeleton,
const char *bus_name,
GdmDisplay *display)
{
- GError *error;
+ GError *error = NULL;
if (gdm_display_set_slave_bus_name (display, bus_name, &error)) {
gdm_dbus_display_complete_set_slave_bus_name (skeleton, invocation);
@@ -1214,7 +1214,7 @@ handle_add_user_authorization (GdmDBusDisplay *skeleton,
GdmDisplay *display)
{
char *filename;
- GError *error;
+ GError *error = NULL;
if (gdm_display_add_user_authorization (display, username, &filename, &error)) {
gdm_dbus_display_complete_add_user_authorization (skeleton,
@@ -1235,7 +1235,7 @@ handle_remove_user_authorization (GdmDBusDisplay *skeleton,
const char *username,
GdmDisplay *display)
{
- GError *error;
+ GError *error = NULL;
if (gdm_display_remove_user_authorization (display, username, &error)) {
gdm_dbus_display_complete_remove_user_authorization (skeleton, invocation);
diff --git a/daemon/gdm-slave.c b/daemon/gdm-slave.c
index 1dd7394..25e63b4 100644
--- a/daemon/gdm-slave.c
+++ b/daemon/gdm-slave.c
@@ -1211,7 +1211,7 @@ x11_session_is_on_seat (GdmSlave *slave,
const char *session_id,
const char *seat_id)
{
- GError *error;
+ GError *error = NULL;
GVariant *reply;
char *sid;
gboolean ret;
diff --git a/gui/libgdm/gdm-client.c b/gui/libgdm/gdm-client.c
index c1757c2..4f173da 100644
--- a/gui/libgdm/gdm-client.c
+++ b/gui/libgdm/gdm-client.c
@@ -145,7 +145,7 @@ on_user_verifier_proxy_created (GdmUserVerifier *user_verifier,
GSimpleAsyncResult *operation_result)
{
- GError *error;
+ GError *error = NULL;
if (!gdm_user_verifier_proxy_new_finish (result, &error)) {
g_simple_async_result_take_error (operation_result, error);
@@ -798,7 +798,7 @@ on_greeter_proxy_created (GdmGreeter *greeter,
GSimpleAsyncResult *operation_result)
{
- GError *error;
+ GError *error = NULL;
if (!gdm_greeter_proxy_new_finish (result, &error)) {
g_simple_async_result_take_error (operation_result, error);
@@ -989,7 +989,7 @@ on_remote_greeter_proxy_created (GdmRemoteGreeter *remote_greeter,
GSimpleAsyncResult *operation_result)
{
- GError *error;
+ GError *error = NULL;
if (!gdm_remote_greeter_proxy_new_finish (result, &error)) {
g_simple_async_result_take_error (operation_result, error);
@@ -1179,7 +1179,7 @@ on_chooser_proxy_created (GdmChooser *chooser,
GSimpleAsyncResult *operation_result)
{
- GError *error;
+ GError *error = NULL;
if (!gdm_chooser_proxy_new_finish (result, &error)) {
g_simple_async_result_take_error (operation_result, error);
diff --git a/gui/simple-greeter/extensions/smartcard/gdm-smartcard-manager.c b/gui/simple-greeter/extensions/smartcard/gdm-smartcard-manager.c
index dfc6ed0..22f1ced 100644
--- a/gui/simple-greeter/extensions/smartcard/gdm-smartcard-manager.c
+++ b/gui/simple-greeter/extensions/smartcard/gdm-smartcard-manager.c
@@ -1399,7 +1399,7 @@ static gboolean should_exit_on_next_remove = FALSE;
static gboolean
on_timeout (GdmSmartcardManager *manager)
{
- GError *error;
+ GError *error = NULL;
g_print ("Re-enabling manager.\n");
if (!gdm_smartcard_manager_start (manager, &error)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]