sshd broken on arm?

Nicholas Clark nick at ccl4.org
Fri Jan 18 14:13:52 PST 2008


On Fri, Jan 18, 2008 at 01:15:49PM -0600, Mark Tinguely wrote:
> 
> <deleted background on sshd failing>

> >  In a C function if you have something like "char tmp[4]", can you assume
> >  that the compiler will align it on a 4 byte boundary or can it do it on
> >  a byte boundary?
> 
> No it will not automatically be align correctly to be used as a integer.
> 
> >  If one cannot access unaligned ints and char arrays are not int aligned,
> >  then we were just lucky that the code worked at some stage.
> 
> The items above this array were probably a multiple of 4 bytes and something
> has changed in a structure to make this no longer true. You can find the
> offending structure and pad it to make it a multiple of 4 bytes, or cheat
> and declare a integer before the char array.

Or put the char array in a union with an integer, although that might require
too many changes in other parts of the code.

Nicholas Clark


More information about the freebsd-arm mailing list