From b4a40f7b4504afcecd7811199099c6572f2b382f Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 10 May 2017 16:56:37 +0200 Subject: [PATCH] utils: handle > 2^31 in lxc_unstack_mountpoint() I mean.. really? But better safe than sorry. Signed-off-by: Christian Brauner --- src/lxc/utils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lxc/utils.c b/src/lxc/utils.c index ae23d4049..778d4da55 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -2221,10 +2221,15 @@ pop_stack: if (errno != EINVAL) return -errno; } else { + /* Just stop counting when this happens. That'd just be so + * stupid that we won't even bother trying to report back the + * correct value anymore. + */ + if (umounts != INT_MAX) + umounts++; /* We succeeded in umounting. Make sure that there's no other * mountpoint stacked underneath. */ - umounts++; goto pop_stack; } -- 2.47.2