Re: [PATCH 01/12] include/xalloc: ensure arithmetics overflow cannot happen

Sami Kerola
2014-04-28T08:42:12Z

On 28 April 2014 07:52, Karel Zak <kzak@redhat.com> wrote:
> On Sun, Apr 27, 2014 at 09:05:27PM +0100, Sami Kerola wrote:
>> The xrealloc() changes has the greatest change. It splits the size and
>> multiplier arguments so that arithmetics overflow can be detected. This
>> change is propagated to use of the function in other files.
>
> I don't like it at all. The function realloc() has well know semantic
> and arguments. We don't want to create parallel universe...
>
> If you want something else "nmemb, size" then introduce xrecalloc()
> or so.. but don't use "realloc" name at all.
>
>> Additionally this change checks that size inputs for allocations are
>> never zero. It is uncertain if in these cases abort() should be called
>> to get a core.
>
> I don't think we need a different semantic than C standards.

Hi Karel,

Considering that, and other feedback, this patch is completely dead.
Please skip, and I'll have look if there is some value to add
xrecalloc() to xalloc.h.

--
Sami Kerola