[Bug 1256] ftpd can generate a misaligned access
chrisj at rtems.org
Wed Aug 29 07:23:16 UTC 2007
Ralf Corsepius wrote:
> Well, that's hardly a proof. I've seen so many urban legends about
> alignment to spend much belief in any such hacks any. So far in almost
> all cases such hacks in the end have shown to be side-effects of other
> bugs (e.g. mis-matches between assumptions on alignment in binutils, GCC
I agree. Proof or not better ways exist to handle the problem.
Why not just use shifts and remove the b array ?
(a << 24) | (a << 16) | (a << 8) | (a << 0)
Is the code ok for network byte order ?
May be the string is turned into a '.' address and then inet_addr (or similar)
More information about the bugs