aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-06-29 22:18:46 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-06-30 13:19:03 +0200
commit9da17f5978a2859f3f05b600f3f64018a28d5e0b (patch)
tree3e61dff2c98eb90eb29e43a5a0ea220e55eaef9d
parent613a1182ff9e8b5ca598e3d233a0e36386559e30 (diff)
downloadmblaze-9da17f5978a2859f3f05b600f3f64018a28d5e0b.tar.gz
mthread: fix infinite recursion
This fixes: References: <5> <4> <6> Message-ID: <3> References: <6> Message-ID: <5> References: <3> <2> Message-ID: <1>
-rw-r--r--mthread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mthread.c b/mthread.c
index 064cbdc..b54b714 100644
--- a/mthread.c
+++ b/mthread.c
@@ -187,6 +187,10 @@ out:
if (parent && parent != c) {
struct container *r;
+ // check we don't introduce a new loop
+ if (reachable(parent, c) || reachable(c, parent))
+ goto out2;
+
if (c->parent == parent) { // already correct
goto out2;
} else if (c->parent) {