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 | 2ecea1d66f7cf56adf485dc082d7cd3ac361e50b (patch) | |
| tree | e6e0a268f788f3a18e915694f0b6f32455427035 /pw/pw.c | |
| parent | 4bdbd4b33ea7d6b88f1425f711bafd4ab04582c7 (diff) | |
| download | pw-darwin-2ecea1d66f7cf56adf485dc082d7cd3ac361e50b.tar.gz pw-darwin-2ecea1d66f7cf56adf485dc082d7cd3ac361e50b.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
Diffstat (limited to 'pw/pw.c')
| -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); |
