Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 21 Jul 2020 20:58:04 +0200
From: Florian Weimer <>
To: Rich Felker <>
Cc: Ariadne Conill <>,
Subject: Re: perhaps we should add re[c]allocarray?

* Rich Felker:

> recallocarray presumably needs to zero the new part which means it
> needs to know the old exact size, which means it depends on having
> either knowledge of implementation internals or a working, exact
> malloc_usable_size (AFAIK all legacy/existing ones except musl
> mallocng are broken and return a value greater than the originally
> allocated size).

The caller has to pass the old member count to recallocarray, in an
additional argument.  I think this avoids this particular issue, and
also makes it easy to achive interposition-safety.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.