From bbc9892535bb5fb8e2571372a9d82513c22732ab Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sat, 27 Mar 2021 08:09:56 +0100 Subject: [PATCH] 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 --- src/lxc/confile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.2