Skip to content

Commit

Permalink
Merge pull request #3494 from eriksjolund/1.1-backport-3489
Browse files Browse the repository at this point in the history
[1.1] libcontainer: relax getenv_int sanity check
  • Loading branch information
kolyshkin authored Jun 2, 2022
2 parents ff14258 + 93d1807 commit da9b9d9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions libcontainer/nsenter/nsexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,9 @@ static int getenv_int(const char *name)
if (val == endptr || *endptr != '\0')
bail("unable to parse %s=%s", name, val);
/*
* Sanity check: this must be a small non-negative number.
* Practically, we pass two fds (3 and 4) and a log level,
* for which the maximum is 6 (TRACE).
* */
if (ret < 0 || ret > TRACE)
* Sanity check: this must be a non-negative number.
*/
if (ret < 0)
bail("bad value for %s=%s (%d)", name, val, ret);

return ret;
Expand Down

0 comments on commit da9b9d9

Please sign in to comment.