diff options
author | John Levon <john.levon@joyent.com> | 2019-01-30 13:58:19 +0000 |
---|---|---|
committer | John Levon <john.levon@joyent.com> | 2019-03-13 19:04:48 +0000 |
commit | 08f1bbed5edd2a2e9c8be7b7424c32e67c2f3f2c (patch) | |
tree | 389e0c87e85fd28c0dea3ac2758262c394139eb6 /usr/src | |
parent | 4a178c575468012cff81a61da4850385129bf983 (diff) | |
download | illumos-joyent-08f1bbed5edd2a2e9c8be7b7424c32e67c2f3f2c.tar.gz |
10323 cpcgen_parse_model() gets value check wrong
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Gergő Doma <domag02@gmail.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/tools/cpcgen/cpcgen.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr/src/tools/cpcgen/cpcgen.c b/usr/src/tools/cpcgen/cpcgen.c index ff00ec15ba..196f2ebd33 100644 --- a/usr/src/tools/cpcgen/cpcgen.c +++ b/usr/src/tools/cpcgen/cpcgen.c @@ -10,7 +10,7 @@ */ /* - * Copyright (c) 2018, Joyent, Inc. + * Copyright (c) 2019, Joyent, Inc. */ /* @@ -317,13 +317,13 @@ cpcgen_parse_model(char *fsr, uint_t *family, uint_t *model) errno = 0; l = strtol(fam, &last, 16); - if (errno != 0 || l < 0 || l > UINT_MAX || *last != '\0') { + if (errno != 0 || l < 0 || l >= INT_MAX || *last != '\0') { errx(EXIT_FAILURE, "failed to parse family \"%s\"", fam); } *family = (uint_t)l; l = strtol(mod, &last, 16); - if (errno != 0 || l < 0 || l > UINT_MAX || *last != '\0') { + if (errno != 0 || l < 0 || l >= INT_MAX || *last != '\0') { errx(EXIT_FAILURE, "failed to parse model \"%s\"", mod); } *model = (uint_t)l; |