confile: use correct check for too large network lists

parent 6712de30
...@@ -4739,7 +4739,7 @@ static struct lxc_config_t *get_network_config_ops(const char *key, ...@@ -4739,7 +4739,7 @@ static struct lxc_config_t *get_network_config_ops(const char *key,
* better safe than sorry. * better safe than sorry.
* (Checking for INT_MAX here is intentional.) * (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"); return log_error_errno(NULL, ERANGE, "Number of configured networks would overflow the counter");
*idx = tmpidx; *idx = tmpidx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment