[SIGAR-129] fix possible integer overflow in time_now_millis
This commit is contained in:
parent
ede7b6c9de
commit
6db07f1cba
|
@ -1254,11 +1254,13 @@ SIGAR_DECLARE(int) sigar_proc_cred_get(sigar_t *sigar, sigar_pid_t pid,
|
|||
|
||||
sigar_int64_t sigar_time_now_millis(void)
|
||||
{
|
||||
SYSTEMTIME st;
|
||||
FILETIME time;
|
||||
|
||||
GetSystemTimeAsFileTime(&time);
|
||||
GetSystemTime(&st);
|
||||
SystemTimeToFileTime(&st, &time);
|
||||
|
||||
return FILETIME2MSEC(time);
|
||||
return sigar_FileTimeToTime(&time) / 1000;
|
||||
}
|
||||
|
||||
SIGAR_DECLARE(int) sigar_proc_time_get(sigar_t *sigar, sigar_pid_t pid,
|
||||
|
|
Loading…
Reference in New Issue