[at-spi2-atk] Don't parse non-existing arguments
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-atk] Don't parse non-existing arguments
- Date: Fri, 19 Dec 2014 18:02:51 +0000 (UTC)
commit 790dc102914a0e42e2d5f99450dbc6eb98bfad54
Author: Benjamin Otte <otte redhat com>
Date: Thu Dec 18 21:45:36 2014 +0100
Don't parse non-existing arguments
The definition of the signal declares 0 arguments, so the listener can't
assume there are any.
Found by Michael Stahl via this valgrind snippet:
==4770== Conditional jump or move depends on uninitialised value(s)
==4770== at 0x3104C10812: text_selection_changed_event_listener
(event.c:1036)
==4770== by 0x30EF42160A: signal_emit_unlocked_R (gsignal.c:3519)
==4770== by 0x30EF42A180: g_signal_emit_valist (gsignal.c:3309)
==4770== by 0x30EF42A8F9: g_signal_emit_by_name (gsignal.c:3405)
==4770== by 0x1835EE96:
AtkListener::notifyEvent(com::sun::star::accessibility::AccessibleEventObject
const&) (atklistener.cxx:454)
==4770== by 0x56E46BA:
comphelper::AccessibleEventNotifier::addEvent(unsigned int,
https://bugzilla.gnome.org/show_bug.cgi?id=741734
atk-adaptor/event.c | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)
---
diff --git a/atk-adaptor/event.c b/atk-adaptor/event.c
index dbfa9dc..d1652da 100644
--- a/atk-adaptor/event.c
+++ b/atk-adaptor/event.c
@@ -1025,7 +1025,6 @@ text_selection_changed_event_listener (GSignalInvocationHint * signal_hint,
AtkObject *accessible;
GSignalQuery signal_query;
const gchar *name, *minor;
- gint detail1 = 0, detail2 = 0;
g_signal_query (signal_hint->signal_id, &signal_query);
name = signal_query.signal_name;
@@ -1033,13 +1032,7 @@ text_selection_changed_event_listener (GSignalInvocationHint * signal_hint,
accessible = ATK_OBJECT (g_value_get_object (¶m_values[0]));
minor = g_quark_to_string (signal_hint->detail);
- if (G_VALUE_TYPE (¶m_values[1]) == G_TYPE_INT)
- detail1 = g_value_get_int (¶m_values[1]);
-
- if (G_VALUE_TYPE (¶m_values[2]) == G_TYPE_INT)
- detail2 = g_value_get_int (¶m_values[2]);
-
- emit_event (accessible, ITF_EVENT_OBJECT, name, minor, detail1, detail2,
+ emit_event (accessible, ITF_EVENT_OBJECT, name, minor, 0, 0,
DBUS_TYPE_STRING_AS_STRING, "", append_basic);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]