[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: s_addr may be a bit field (ITS#340)

> > Not necessarily; the enclosing structure will likely be bigger than
> > the bit field.
> > I think there are some usages in OpenLDAP where this could be a
> > problem.  I recall seeing places where it does a memcpy to a target
> > object (a char array?) that might be only 4 bytes.
> Then these should be fixed.

Hmm.  I haven't looked closely at the code, but I'm not sure whether
the target *should* be 4 bytes or 8 -- or, to state it more portably,
whether it should be the size of the s_addr member (32 bits) or the
size of the enclosing structure (possibly 32 bits, possibly padded
to 64 bits, conceivable something else entirely).  The problem is,
there are 32 bits of useful information there.

I'll take a closer look at it Monday or so -- or better yet, perhaps
someone who understands this stuff better than I do can look at it.

Keith Thompson, San Diego Supercomputer Center  kst@sdsc.edu
<http://www.sdsc.edu/~kst/>  Office: 858-822-0853  Fax: 858-534-5077
"Oh my gosh!  You are SO ahead of your time!" -- anon.