[patch] Fix BZ 19165 -- overflow in fread / fwrite
Florian Weimer
fweimer@redhat.com
Thu Dec 10 19:49:00 GMT 2015
On 12/10/2015 08:43 PM, Paul Pluzhnikov wrote:
> On Mon, Dec 7, 2015 at 10:52 AM, Paul Eggert <eggert@cs.ucla.edu> wrote:
>
>> The above comments suggest that this patch is part of a larger maintenance
>> problem with glibc and integer overflow checking. To simplify maintenance,
>> I suggest instead that we leave cdefs.h alone, and instead copy and include
>> gnulib's intprops.h for internal use only inside glibc, and use intprops.h's
>> macro 'INT_MULTIPLY_OVERFLOW (a, b)' instead of defining and using
>> '__umul_size_t_overflow (a, b)'. This would simplify maintenance in the
>> long run, as it already incorporates all the above comments. Please see:
>>
>> http://git.savannah.gnu.org/cgit/gnulib.git/tree/lib/intprops.h
>
> Sigh. A "simple" overflow check in _IO_fread turned into a multi-month
> ordeal ...
I don't think we want to import intprops.h because it is totally opaque.
> While I agree that what you are proposing is probably better, I am not
> currently prepared to undertake that change. I'll un-assign BZ19165
> from myself instead.
Do you mind if I try to move this forward?
Thanks,
Florian
More information about the Libc-alpha
mailing list