aboutsummaryrefslogtreecommitdiff
path: root/contrib/ntp/libntp/vint64ops.c
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2023-06-01 14:04:37 +0000
committerCy Schubert <cy@FreeBSD.org>2023-06-01 15:06:46 +0000
commit91ae4636fbf299134427aecebbd514fef467cbc6 (patch)
treec96c809e24062c748b7e6cd94918665a80fa6cc2 /contrib/ntp/libntp/vint64ops.c
parentcf3a76018cadf9bb39c90badb13e779415bafe37 (diff)
ntp: import ntp-4.2.8p16
Security: NtpBUg3767, NtpBug3808, NtpBug3807 (CVE-2023-26555) (cherry picked from commit a466cc55373fc3cf86837f09da729535b57e69a1)
Diffstat (limited to 'contrib/ntp/libntp/vint64ops.c')
-rw-r--r--contrib/ntp/libntp/vint64ops.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/contrib/ntp/libntp/vint64ops.c b/contrib/ntp/libntp/vint64ops.c
index 5adbebbb51d4..1d5087d95438 100644
--- a/contrib/ntp/libntp/vint64ops.c
+++ b/contrib/ntp/libntp/vint64ops.c
@@ -17,32 +17,13 @@
#include "ntp_fp.h"
#include "vint64ops.h"
-/* ---------------------------------------------------------------------
- * GCC is rather sticky with its 'const' attribute. We have to do it more
- * explicit than with a cast if we want to get rid of a CONST qualifier.
- * Greetings from the PASCAL world, where casting was only possible via
- * untagged unions...
- */
-static inline void*
-noconst(
- const void* ptr
- )
-{
- union {
- const void * cp;
- void * vp;
- } tmp;
- tmp.cp = ptr;
- return tmp.vp;
-}
-
/* -------------------------------------------------------------------------*/
vint64
strtouv64(
- const char * begp,
- char ** endp,
- int base
+ char const * begp,
+ char const ** const endp,
+ int base
)
{
vint64 res;
@@ -116,7 +97,7 @@ strtouv64(
if (!num)
errno = EINVAL;
if (endp)
- *endp = (char*)noconst(src);
+ *endp = (const char *)src;
if (sig)
M_NEG(res.D_s.hi, res.D_s.lo);
return res;