Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <em87ed1359-4569-49fb-8bfb-577c8759b02c@c27c3d22.com>
Date: Tue, 17 Jun 2025 17:38:03 +0000
From: "Laurent Bercot" <ska-dietlibc@...rnet.org>
To: musl@...ts.openwall.com, enh <enh@...gle.com>
Cc: "Alejandro Colomar" <alx@...nel.org>, "Florian Weimer" <fweimer@...hat.com>,
 "Adhemerval Zanella Netto" <adhemerval.zanella@...aro.org>,
 musl@...ts.openwall.com, libc-alpha@...rceware.org, "Joseph Myers"
 <josmyers@...hat.com>, наб
 <nabijaczleweli@...ijaczleweli.xyz>, "Paul Eggert" <eggert@...ucla.edu>,
 "Robert Seacord" <rcseacord@...il.com>, "Bruno Haible" <bruno@...sp.org>,
 bug-gnulib@....org, "JeanHeyd Meneide" <phdofthehouse@...il.com>
Subject: Re[2]: Re: BUG: realloc(p,0) should be consistent with malloc(0)

>And folks who do
>know aren't complaining that it's broken, because the behavior is
>currently conforming just bad. Rather they're tiptoeing around the
>issue by special-casing zero and making sure they never pass zero to
>realloc, or wrapping it to do that, etc.

  Anecdotal data point: it's exactly what I do, wrapping all the malloc
and realloc calls so that they're never passed 0. It's by far the
simplest solution for now, at the occasional cost of 1 byte of memory.
It would be nice to have this fixed, *and standardized*; the workarounds
aren't going away until it is, and until every libc deployed under the
sun implements the new, better standard. I'm not holding my breath.

--
  Laurent

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.