On 05/06/14 00:10, Matthew Dempsky wrote:
On Sun, May 4, 2014 at 8:26 PM, Jean-Philippe Ouellet
<jean-phili...@ouellet.biz> wrote:
On Sun, May 04, 2014 at 11:30:40PM +0200, Alexander Hall wrote:
NULL theoretically could be != 0
Umm... short of something like:
#undef NULL
#define NULL "I'm silly and want to break everything"
or something, I don't see when that'd be the case.
I assumed from context that halex@ was asking about null pointers
having a non-zero memory representation, which is allowed by ISO C and
POSIX. But all OpenBSD platforms guarantee that all-bits-are-zero
pointer values are null pointers.
Yeah, I don't know much about standards, but that sounds like what my
mind was referring to. :-)
I'm almost certain that OpenSSH probably relies on this in places too,
so I think we're fine to rely on it in LibreSSL.
I believe a similar situation could appear with not explicitly
initialized global or static declarations, e.g. in
sbin/fsirand/fsirand.c:
fsirand(char *device)
{
...
static char *inodebuf;
...
if ((ib = realloc(inodebuf, ibufsize)) == NULL)
...
}
Anyway, since people more knowledgeable than me on the topic (meaning
lots of people) do not consider this an issue, I guess it isn't.
/Alexander