Skip to contentSkip to conversation

Fix: sanity check in iterator creation

PATCH New Julien Desfossez 2 participants 2 messages Nov 18, 2014 – Dec 2, 2014 2 messages not in the archive Library code

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 2/2 Fix: sanity check in iterator creation

This function is part of the API, so we need more sanity checks before using the structures provided by the caller.

Refs: #827

---
 lib/iterator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/iterator.c +1 -1
index d2464ab..540d5e9 100644
@@ -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) {
Signature · 1 line
1.9.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Both patches were merged in master and stable-1.2.

Thanks!
Jérémie

Quoted 26 lines · Julien Desfossez

This function is part of the API, so we need more sanity checks before using the structures provided by the caller.

Refs: #827

---
 lib/iterator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/iterator.c +1 -2
index d2464ab..540d5e9 100644
@@ -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

Signature · 8 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev