From: Christian Brauner Date: Wed, 10 May 2017 14:56:37 +0000 (+0200) Subject: utils: handle > 2^31 in lxc_unstack_mountpoint() X-Git-Tag: lxc-2.1.0~137^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1548%2Fhead;p=thirdparty%2Flxc.git utils: handle > 2^31 in lxc_unstack_mountpoint() I mean.. really? But better safe than sorry. Signed-off-by: Christian Brauner --- 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; }