Fix : callback chain len
authorJulien Desfossez <julien.desfossez@efficios.com>
Fri, 17 Feb 2012 16:40:47 +0000 (11:40 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 17 Feb 2012 16:40:47 +0000 (11:40 -0500)
Wrong check caused a segmentation fault when checking for a callback at
the end of the callback chain.

Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/callbacks.c

index 591f5109f15de2af16b9aff5cfc2c5ef2f8afcbe..0dfb19c277c62112a54b4db58074d1c9fffdfdb2 100644 (file)
@@ -205,7 +205,7 @@ void process_callbacks(struct bt_iter *iter,
        if (!bt_stream_cb || !bt_stream_cb->per_id_callbacks)
                goto end;
 
-       if (stream->event_id > bt_stream_cb->per_id_callbacks->len)
+       if (stream->event_id >= bt_stream_cb->per_id_callbacks->len)
                goto end;
        bt_chain = &g_array_index(bt_stream_cb->per_id_callbacks,
                        struct bt_callback_chain, stream->event_id);
This page took 0.032936 seconds and 4 git commands to generate.