This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix BZ 19165 -- overflow in fread / fwrite


On 2015-10-26 06:49, Paul Pluzhnikov wrote:
Attached patch fixes BZ 19165 by failing fwrite when the byte count is
impossibly large,

I think this goes against the standard. In such cases fwrite should go until an error. A saturated multiplication, as proposed by Florian, is probably a good idea.

and by returning actual count from fread, instead of
approximation of it.

Thanks, this should eliminate the main concern (please note though that, after wrapping, bytes_requested and hence bytes_read may be not evenly divisible by size). But I think this is not enough to be standard-compliant.

--
Alexander Cherepanov


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]