From 0977c023aa434004bc56d789c4072c49068ebd67 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 48df7e3a9..fff58859f 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -4739,7 +4739,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.3