1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00
2000-04-10  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/clock_settime.c (clock_settime): Test tv_nsec value
	for correct range.  From code by Kaz Kylheku <kaz@ashi.footprints.net>.
This commit is contained in:
Ulrich Drepper
2000-04-10 15:30:06 +00:00
parent 13fa367696
commit e79af11c36
2 changed files with 12 additions and 0 deletions

View File

@ -31,6 +31,13 @@ clock_settime (clockid_t clock_id, const struct timespec *tp)
struct timeval tv;
int retval;
/* Make sure the time cvalue is OK. */
if (tp->tv_nsec < 0 || tp->tv_nsec >= 1000000000)
{
__set_errno (EINVAL);
return -1;
}
switch (clock_id)
{
case CLOCK_REALTIME: