tal: check headers more carefully.
[ccan] / ccan / tal / tal.c
index 350b34be9d902ee2ae531cdf04bbe531cc2c7943..8245aba95028d90a007eb0c4b6edf83284d9b984 100644 (file)
@@ -154,11 +154,11 @@ static struct tal_hdr *to_tal_hdr(const void *ctx)
 
        t = (struct tal_hdr *)((char *)ctx - sizeof(struct tal_hdr));
        check_bounds(t);
-       if (t->prop && !is_literal(t->prop))
-               check_bounds(t->prop);
        check_bounds(ignore_destroying_bit(t->parent_child));
        check_bounds(t->list.next);
        check_bounds(t->list.prev);
+       if (t->prop && !is_literal(t->prop))
+               check_bounds(t->prop);
        return t;
 }