Fix: sanity check in iterator creation
authorJulien Desfossez <jdesfossez@efficios.com>
Tue, 18 Nov 2014 17:52:32 +0000 (12:52 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 2 Dec 2014 16:11:44 +0000 (11:11 -0500)
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 <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/iterator.c

index d2464ab7c4f8274e2fadee6e70a6f8a51f76dcc4..540d5e9bcf04b6ba46ca99c2a66db9ec7e31ec74 100644 (file)
@@ -720,7 +720,7 @@ int bt_iter_init(struct bt_iter *iter,
        int i;
        int ret = 0;
 
        int i;
        int ret = 0;
 
-       if (!iter || !ctx)
+       if (!iter || !ctx || !ctx->tc || !ctx->tc->array)
                return -EINVAL;
 
        if (ctx->current_iterator) {
                return -EINVAL;
 
        if (ctx->current_iterator) {
This page took 0.024491 seconds and 4 git commands to generate.