2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 21:15:17 +00:00

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 <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner
2021-03-27 08:09:56 +01:00
parent 6a52a513f9
commit bbc9892535

View 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;