mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-19 01:58:37 +08:00
attrib: Don't attempt to unregister event id 0
Id 0 is considered invalid so the code should not even try to lookup for it in the event list instead print a warning and return FALSE immediatelly.
This commit is contained in:
parent
9c410e37f4
commit
667cb4c469
@ -719,6 +719,11 @@ gboolean g_attrib_unregister(GAttrib *attrib, guint id)
|
||||
struct event *evt;
|
||||
GSList *l;
|
||||
|
||||
if (id == 0) {
|
||||
warn("%s: invalid id", __FUNCTION__);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
l = g_slist_find_custom(attrib->events, GUINT_TO_POINTER(id),
|
||||
event_cmp_by_id);
|
||||
if (l == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user