dlm: fix length calculation in compat code
authorDavid Teigland <teigland@redhat.com>
Wed, 4 Mar 2009 17:17:23 +0000 (11:17 -0600)
committerDavid Teigland <teigland@redhat.com>
Wed, 11 Mar 2009 17:23:59 +0000 (12:23 -0500)
Using offsetof() to calculate name length does not work because
it does not produce consistent results with with structure packing.
This caused memcpy to corrupt memory by copying 4 extra bytes off
the end of the buffer on 64 bit kernels with 32 bit userspace
(the only case where this 32/64 compat code is used).

The fix is to calculate name length directly from the start instead
of trying to derive it later using count and offsetof.

Signed-off-by: David Teigland <teigland@redhat.com>

No differences found