From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 Firefox/1.0.7 Description of problem: If a bad buffer address is passed to time(2), rather than return (time_t)-1 and set errno to EFAULT, "-EFAULT" (-14) is returned directly to the caller. Version-Release number of selected component (if applicable): glibc-2.3.5-10.3 How reproducible: Always Steps to Reproduce: 1. Compile the following program: #include <sys/types.h> #include <time.h> #include <stdio.h> main() { time_t tick; tick = time((time_t *)1); if (tick == (time_t)-1) perror("time"); else printf("time() returned %d: %s", tick, ctime(&tick)); } 2. Run the program Actual Results: time() returned -14: Wed Dec 31 16:59:46 1969 Expected Results: time: Bad address Additional info: This appears to be a long-standing bug in glibc where it apparently is not doing its normal "a negative return value from a syscall means a a failure with errno -return_value" processing, likely due to the fact that large negative values may be returned from the time syscall as time speeds away from the epoch.
Fixed in 2.3.90-20.