This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] Fix BZ 19165 -- overflow in fread / fwrite
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Rich Felker <dalias at libc dot org>, GLIBC Devel <libc-alpha at sourceware dot org>, Alexander Cherepanov <ch3root at openwall dot com>, Florian Weimer <fweimer at redhat dot com>
- Date: Tue, 27 Oct 2015 06:59:09 -0700
- Subject: Re: [patch] Fix BZ 19165 -- overflow in fread / fwrite
- Authentication-results: sourceware.org; auth=none
- References: <CALoOobOpSFwNOqD2RbsSQ95+16=xWN=fTpDJZqgPGJPSXCDmEA at mail dot gmail dot com> <20151026200605 dot GI8645 at brightrain dot aerifal dot cx> <CALoOobPxCPN_Lwvc98CevgCJMwHa_9cURZsALsLeG+SPDSF+Xw at mail dot gmail dot com> <20151027042627 dot GA25140 at vapier dot lan> <CALoOobOiP=n=2cDEN6Det+EKrr3XO0BrWC=6St4t9C98_Vo6mw at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1510271049140 dot 28087 at digraph dot polyomino dot org dot uk>
On Tue, Oct 27, 2015 at 3:51 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Mon, 26 Oct 2015, Paul Pluzhnikov wrote:
>
>> static inline bool
>> __attribute__ ((__always_inline))
>> __umull_overflow (size_t a, size_t b)
>
> I don't approve of function naming that quietly embeds the assumption that
> size_t and unsigned long have the same set of values.
>
> If you want a multiplication function for size_t, whether saturating or
> setting an explicit overflow flag, then the name should make clear that
> it's for size_t.
__umul_size_t_overflow ?
__glibc_mul_size_t_overflow ?
Other suggestions?
Thanks.
--
Paul Pluzhnikov