]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
utils: handle > 2^31 in lxc_unstack_mountpoint() 1548/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 10 May 2017 14:56:37 +0000 (16:56 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 10 May 2017 16:28:09 +0000 (18:28 +0200)
I mean.. really? But better safe than sorry.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/utils.c

index ae23d404994e0268112d890397b227d1f4cc1801..778d4da55233c3aec3ece2285b827cddf2278b8f 100644 (file)
@@ -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;
        }