mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 02:37:19 +02:00
Set errno in adjtime if delta is too large
errno should be set to EINVAL in this case according to adjtime's man page.
This commit is contained in:
committed by
KonstantinKondrashov
parent
7ccacc7385
commit
6802299ef4
@ -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;
|
||||
}
|
||||
/*
|
||||
|
Reference in New Issue
Block a user