Use TASK_THREAD_TIMES_INFO_COUNT when calling task_info with TASK_THREAD_TIMES_INFO
authorFlavio Cruz <flaviocruz@gmail.com>
Wed, 17 May 2023 02:59:24 +0000 (22:59 -0400)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Wed, 17 May 2023 17:23:10 +0000 (19:23 +0200)
This hasn't caused any problems yet but we are passing a pointer to struct
task_thread_times_info which can cause problems if we populate over the
existing size of the struct.
Message-Id: <ZGRDDNcOM2hA3CuT@jupiter.tail36e24.ts.net>

sysdeps/mach/clock_gettime.c

index cc8c821..be775ed 100644 (file)
@@ -62,7 +62,7 @@ __clock_gettime (clockid_t clock_id, struct timespec *ts)
        time_value_add (&t, &bi.system_time);
 
        /* Live threads CPU time.  */
-       count = TASK_EVENTS_INFO_COUNT;
+       count = TASK_THREAD_TIMES_INFO_COUNT;
        err = __task_info (__mach_task_self (), TASK_THREAD_TIMES_INFO,
                           (task_info_t) &tti, &count);
        if (err)