diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-07-28 21:10:58 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-07-28 21:10:58 +0000 |
commit | 7fe27302ca1b955d97360f508b462470b593b0db (patch) | |
tree | 713cc22cf2f3b2a086f7863d68873f32be6f9f7e | |
parent | 43b633f69fb3ebcb515312aae6a8df74e26097d9 (diff) | |
download | pw-darwin-7fe27302ca1b955d97360f508b462470b593b0db.tar.gz pw-darwin-7fe27302ca1b955d97360f508b462470b593b0db.tar.zst pw-darwin-7fe27302ca1b955d97360f508b462470b593b0db.zip |
Check uid/gid used when creating a user/group are not larger than UID_MAX/GID_MAX
PR: 173977
Reported by: nvass@gmx.com
-rw-r--r-- | pw/pw.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -269,7 +269,7 @@ main(int argc, char *argv[]) } if (strspn(optarg, "0123456789") != strlen(optarg)) errx(EX_USAGE, "-g expects a number"); - id = strtonum(optarg, 0, LONG_MAX, &errstr); + id = strtonum(optarg, 0, GID_MAX, &errstr); if (errstr != NULL) errx(EX_USAGE, "Bad id '%s': %s", optarg, errstr); @@ -281,7 +281,7 @@ main(int argc, char *argv[]) addarg(&arglist, 'u', optarg); break; } - id = strtonum(optarg, 0, LONG_MAX, &errstr); + id = strtonum(optarg, 0, UID_MAX, &errstr); if (errstr != NULL) errx(EX_USAGE, "Bad id '%s': %s", optarg, errstr); |