diff options
author | Mike Gorse <mgorse@suse.com> | 2019-08-19 15:23:59 +0000 |
---|---|---|
committer | Mike Gorse <mgorse@suse.com> | 2019-08-19 15:23:59 +0000 |
commit | 5b5c7208027039f2f9aadf05277eaf256020db2c (patch) | |
tree | 654eb29ca65de9626cb6ade3e643280f38e290a2 | |
parent | 9ad8a590a260ad9916767c872d83a557d578308d (diff) | |
parent | ffedc3504b0d1984f46dcbc61da325bbcc9dee0b (diff) | |
download | at-spi2-atk-5b5c7208027039f2f9aadf05277eaf256020db2c.tar.gz |
Merge branch 'initialized' into 'master'
Make sure returned values are initialized
See merge request GNOME/at-spi2-atk!8
-rw-r--r-- | atk-adaptor/adaptors/socket-adaptor.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/atk-adaptor/adaptors/socket-adaptor.c b/atk-adaptor/adaptors/socket-adaptor.c index ed6faa3..c81b2d8 100644 --- a/atk-adaptor/adaptors/socket-adaptor.c +++ b/atk-adaptor/adaptors/socket-adaptor.c @@ -76,14 +76,24 @@ atspi_plug_component_get_extents (AtkComponent *component, gint *x, gint *y, message, -1, &error); dbus_message_unref (message); if (!reply) - return; + { + *x = -1; + *y = -1; + *width = -1; + *height = -1; + return; + } signature = dbus_message_get_signature (reply); if (g_strcmp0 (signature, "(iiii)") != 0) - { - g_warning ("Got unexpected signature %s from GetExtents\n", signature); - dbus_message_unref (reply); - return; - } + { + g_warning ("Got unexpected signature %s from GetExtents\n", signature); + dbus_message_unref (reply); + *x = -1; + *y = -1; + *width = -1; + *height = -1; + return; + } dbus_message_iter_init (reply, &iter); dbus_message_iter_recurse (&iter, &iter_struct); dbus_message_iter_get_basic (&iter_struct, &tmp); @@ -116,12 +126,18 @@ atspi_plug_component_get_position (AtkComponent *component, gint *x, gint *y, message, -1, &error); dbus_message_unref (message); if (!reply) - return; + { + *x = -1; + *y = -1; + return; + } if (!dbus_message_get_args (reply, NULL, DBUS_TYPE_INT32, &x_dbus, DBUS_TYPE_INT32, &y_dbus, DBUS_TYPE_INVALID)) { g_warning ("GetPosition failed: %s", error.message); dbus_error_free (&error); + *x = -1; + *y = -1; } else { @@ -145,12 +161,18 @@ atspi_plug_component_get_size (AtkComponent *component, message, -1, &error); dbus_message_unref (message); if (!reply) - return; + { + *width = -1; + *height = -1; + return; + } if (!dbus_message_get_args (reply, NULL, DBUS_TYPE_INT32, &width_dbus, DBUS_TYPE_INT32, &height_dbus, DBUS_TYPE_INVALID)) { g_warning ("GetSize failed: %s", error.message); dbus_error_free (&error); + *width = -1; + *height = -1; } else { |