summaryrefslogtreecommitdiff
path: root/atspi/atspi-event-listener.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2021-12-14 14:13:58 -0600
committerFederico Mena Quintero <federico@gnome.org>2021-12-14 14:13:58 -0600
commitd818a9f8d2fb23d149b54ee1c24568981f9789ad (patch)
treea1ce70e83fd124e41f4528f05f179190dc0b9aa2 /atspi/atspi-event-listener.c
parent7533f8591245bbe4d49fd731ca5cfaf94736939a (diff)
downloadat-spi2-core-d818a9f8d2fb23d149b54ee1c24568981f9789ad.tar.gz
_atspi_dbus_handle_event(): assert that the event source is not NULL before processing the event
Once we demarshal, the event.source should not be NULL. It can come from the message path if it is *not* being a ScreenReader event, or from a variant argument. Fixes static-scan warnings of this sort: ../../../atspi/atspi-event-listener.c:248:9: warning: Access to field 'accessible_parent' results in a dereference of a null pointer (loaded from field 'source') [core.NullDereference] if (event->source->accessible_parent) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Diffstat (limited to 'atspi/atspi-event-listener.c')
-rw-r--r--atspi/atspi-event-listener.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/atspi/atspi-event-listener.c b/atspi/atspi-event-listener.c
index b5d7fe4e..5cdc8064 100644
--- a/atspi/atspi-event-listener.c
+++ b/atspi/atspi-event-listener.c
@@ -1094,6 +1094,8 @@ _atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data)
break;
}
+ g_assert (e.source != NULL);
+
dbus_message_iter_next (&iter);
if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_ARRAY)
{