From: Christian Brauner Date: Sat, 27 Mar 2021 07:09:56 +0000 (+0100) Subject: confile: use correct check for too large network lists X-Git-Tag: lxc-5.0.0~237^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbc9892535bb5fb8e2571372a9d82513c22732ab;p=thirdparty%2Flxc.git confile: use correct check for too large network lists Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32558 Signed-off-by: Christian Brauner --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 6dd25c6ab..4ce958e62 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -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;