[lttng-dev] [BABELTRACE PATCH 2/2] Fix: sanity check in iterator creation

Jérémie Galarneau jeremie.galarneau at efficios.com
Tue Dec 2 11:16:28 EST 2014


Both patches were merged in master and stable-1.2.

Thanks!
Jérémie

On Tue, Nov 18, 2014 at 12:52 PM, Julien Desfossez
<jdesfossez at efficios.com> wrote:
> This function is part of the API, so we need more sanity checks before
> using the structures provided by the caller.
>
> Refs: #827
>
> Signed-off-by: Julien Desfossez <jdesfossez at efficios.com>
> ---
>  lib/iterator.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/iterator.c b/lib/iterator.c
> index d2464ab..540d5e9 100644
> --- a/lib/iterator.c
> +++ b/lib/iterator.c
> @@ -720,7 +720,7 @@ int bt_iter_init(struct bt_iter *iter,
>         int i;
>         int ret = 0;
>
> -       if (!iter || !ctx)
> +       if (!iter || !ctx || !ctx->tc || !ctx->tc->array)
>                 return -EINVAL;
>
>         if (ctx->current_iterator) {
> --
> 1.9.1
>



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list