Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.BSM.4.64L.2511011335450.13295@herc.mirbsd.org>
Date: Sat, 1 Nov 2025 13:38:41 +0000 (UTC)
From: Thorsten Glaser <tg@...bsd.de>
To: musl@...ts.openwall.com
cc: Thiago Macieira <thiago@...ieira.org>, Alejandro Colomar <alx@...nel.org>,
        libc-alpha@...rceware.org, "A. Wilcox" <AWilcox@...cox-tech.com>,
        Lénárd Szolnoki <cpp@...ardszolnoki.com>,
        Collin Funk <collin.funk1@...il.com>,
        "Arthur O'Dwyer" <arthur.j.odwyer@...il.com>,
        Jonathan Wakely <jwakely@...hat.com>,
        "Paul E. McKenney" <paulmck@...nel.org>
Subject: Re: Re: realloci(): A realloc() variant that works in-place

Paul Eggert dixit:

> You're right I'm not saying that. All I'm saying is that when
> R=realloc(P,N) succeeds, you can assume that you can adjust old
> pointers into the object addressed by P by adding R-P to them. The C
> standard says this results in undefined behavior; all that we need to
> do is fix the C standard to say it's well-defined (because it is on
> practical platforms).

That won’t fix old standard versions retroactively though.

You can already do this now by casting the old pointer to
ptraddr_t (ifdef __CHERI__) / uintptr_t (else) before the
realloc and the new one afterwards for comparison and the
arithmetic.

bye,
//mirabilos
-- 
13:28⎜«neurodamage:#cvs» you're a handy guy to have around for systems stuff ☺
16:06⎜<Draget:#cvs> Thank god I found you =)   20:03│«bioe007:#cvs» mira2k: ty
17:14⎜<ldiain:#cvs> Thanks big help you are :-)   <bioe007> mira|nwt: ty again
18:36⎜«ThunderChicken:#cvs» mirabilos FTW!  23:03⎜«mithraic:#cvs» aaah. thanks

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.