]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: Make adjtime reject out-of-range tv_usec values
authorMichael Kelly <mike@weatherwax.co.uk>
Wed, 15 Apr 2026 20:15:39 +0000 (22:15 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Wed, 15 Apr 2026 20:18:01 +0000 (22:18 +0200)
sysdeps/mach/hurd/adjtime.c

index c25b666a222ab2989384891c7e0d576c18a8a8f6..915b86da139f7456cc2190db32d2e031c2132726 100644 (file)
@@ -37,6 +37,13 @@ __adjtime (const struct timeval *delta, struct timeval *olddelta)
   if (olddelta == NULL)
     olddelta = &dummy;
 
+  if (delta != NULL)
+    {
+      if (delta->tv_usec >=  TIME_MICROS_MAX ||
+          delta->tv_usec <= -TIME_MICROS_MAX)
+       return EINVAL;
+    }
+
   err = __host_adjust_time (hostpriv,
                            /* `time_value_t' and `struct timeval' are in
                                fact identical with the names changed.  */