[PATCH v2] Add tests of fread [committed]
DJ Delorie
dj@redhat.com
Tue Sep 24 17:18:29 GMT 2024
Joseph Myers <josmyers@redhat.com> writes:
>> I wonder if it would be useful to have a test that makes sure
>> fread(x,-1,-1,y) doesn't blindly multply -1*-1 and read one
>> byte... (yes, I know they're unsigned).
>
> Testing overflow like that is problematic. The handling of overflow
> is arguably buggy, but apparently the Linux kernel expects a buffer as
> large as the passed size even if in fact you know there will be EOF
> long before then. See bug 19165 and the past discussion referenced
> therein.
Oh, I would expect errors. Errors would be *good*. What I wouldn't
expect was a return value of 1.
More information about the Libc-alpha
mailing list