summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/sntp/libopts/enum.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2016-01-22 15:55:21 +0000
committerdelphij <delphij@FreeBSD.org>2016-01-22 15:55:21 +0000
commit0e1dba9a0aa72f6f27001a50552a8c67575da336 (patch)
treedbb1c1e8cb8058b52ef547a1f18b9751613aeb04 /contrib/ntp/sntp/libopts/enum.c
parent7a67cba86b1ced9982ebb0dd11a9a987829efe9e (diff)
downloadFreeBSD-src-0e1dba9a0aa72f6f27001a50552a8c67575da336.zip
FreeBSD-src-0e1dba9a0aa72f6f27001a50552a8c67575da336.tar.gz
MFC r294554: MFV r294491: ntp 4.2.8p6.
Security: CVE-2015-7973, CVE-2015-7974, CVE-2015-7975 Security: CVE-2015-7976, CVE-2015-7977, CVE-2015-7978 Security: CVE-2015-7979, CVE-2015-8138, CVE-2015-8139 Security: CVE-2015-8140, CVE-2015-8158 With hat: so
Diffstat (limited to 'contrib/ntp/sntp/libopts/enum.c')
-rw-r--r--contrib/ntp/sntp/libopts/enum.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/ntp/sntp/libopts/enum.c b/contrib/ntp/sntp/libopts/enum.c
index 3345558..e9bba83 100644
--- a/contrib/ntp/sntp/libopts/enum.c
+++ b/contrib/ntp/sntp/libopts/enum.c
@@ -189,12 +189,12 @@ find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
* The result gets stashed in a char * pointer.
*/
uintptr_t res = name_ct;
- size_t len = strlen((char *)name);
+ size_t len = strlen(name);
uintptr_t idx;
if (IS_DEC_DIGIT_CHAR(*name)) {
- char * pz = VOIDP(name);
- unsigned long val = strtoul(pz, &pz, 0);
+ char * pz;
+ unsigned long val = strtoul(name, &pz, 0);
if ((*pz == NUL) && (val < name_ct))
return (uintptr_t)val;
pz_enum_err_fmt = znum_too_large;
@@ -215,7 +215,7 @@ find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
* Multiple partial matches means we have an ambiguous match.
*/
for (idx = 0; idx < name_ct; idx++) {
- if (strncmp((char *)paz_names[idx], (char *)name, len) == 0) {
+ if (strncmp(paz_names[idx], name, len) == 0) {
if (paz_names[idx][len] == NUL)
return idx; /* full match */
@@ -500,7 +500,7 @@ find_member_bit(tOptions * opts, tOptDesc * od, char const * pz, int len,
if (shift_ct >= nm_ct)
return 0UL;
- return 1UL << shift_ct;
+ return (uintptr_t)1U << shift_ct;
}
}
OpenPOWER on IntegriCloud