]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: use correct check for too large network lists
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 27 Mar 2021 07:09:56 +0000 (08:09 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 27 Mar 2021 07:09:56 +0000 (08:09 +0100)
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32558
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index 6dd25c6ab36ea8506a29e6ca9b0abf9eed9bf843..4ce958e623ea4deaf2ad8e413ef46f14368d8857 100644 (file)
@@ -5202,7 +5202,7 @@ static struct lxc_config_t *get_network_config_ops(const char *key,
         * better safe than sorry.
         * (Checking for INT_MAX here is intentional.)
         */
-       if (tmpidx == INT_MAX)
+       if (tmpidx >= INT_MAX)
                return log_error_errno(NULL, ERANGE, "Number of configured networks would overflow the counter");
        *idx = tmpidx;