Set errno in adjtime if delta is too large

errno should be set to EINVAL in this case according to adjtime's man
page.
pull/11147/head
jofrev 2022-12-08 22:32:31 +00:00 zatwierdzone przez KonstantinKondrashov
rodzic 7ccacc7385
commit 6802299ef4
1 zmienionych plików z 1 dodań i 0 usunięć

Wyświetl plik

@ -137,6 +137,7 @@ int adjtime(const struct timeval *delta, struct timeval *outdelta)
int64_t sec = delta->tv_sec;
int64_t usec = delta->tv_usec;
if(llabs(sec) > ((INT_MAX / 1000000L) - 1L)) {
errno = EINVAL;
return -1;
}
/*