From: Julien Desfossez Date: Tue, 18 Nov 2014 17:52:32 +0000 (-0500) Subject: Fix: sanity check in iterator creation X-Git-Tag: v1.3.0~51 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=4fd5ac4b22481d3c7e3f471cdc34ccfdcea4c781 Fix: sanity check in iterator creation This function is part of the public API; we need more sanity checks before using the structures provided by the caller. Refs: #827 Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- diff --git a/lib/iterator.c b/lib/iterator.c index d2464ab7..540d5e9b 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) {