bug in times.c
Siddhesh Poyarekar
siddhesh.poyarekar@gmail.com
Mon Mar 11 12:05:00 GMT 2013
On 11 March 2013 16:53, Petr Baudis <pasky@ucw.cz> wrote:
> - /* If we come here the memory is valid and the kernel did not
> + /* If we come here the memory is valid (or BUF is NULL, which is
> + * a valid condition for the kernel syscall) and the kernel did not
> return an EFAULT error. Return the value given by the kernel. */
Please also fix the comment above it which says:
"We crash applications which pass in an invalid BUF pointer."
to:
"We crash applications which pass in an invalid non-NULL BUF
pointer. Linux allows BUF to be NULL."
The touch() is deliberate to ensure that we don't mistake an EFAULT
for a valid return value. However, the kernel will never send us an
EFAULT if buffer is NULL, so it is safe to bypass it. The change
looks OK to me with the above modification to the comment.
Siddhesh
--
http://siddhesh.in
More information about the Libc-alpha
mailing list