[patch] Fix BZ 19165 -- overflow in fread / fwrite
Paul Eggert
eggert@cs.ucla.edu
Thu Feb 11 17:57:00 GMT 2016
On 02/11/2016 07:58 AM, Zack Weinberg wrote:
> I don't think anyone wants the behavior to vary depending on which
> kind of fd you have passed to read().
As an application developer I'd rather have 'read', 'fread', etc. fail,
or even dump core, if I give them a buffer that is not entirely valid. I
hope, for example, that checkers like valgrind object to this sort of
thing, and would find it useful if glibc continues to report it as an
error. If POSIX really requires that 'read' and 'fread' must succeed in
this situation, then from my point of view it's a POSIX bug that needs
to get fixed, as the benefit of the extra checking is significant.
More information about the Libc-alpha
mailing list