From 5bc82e443b2da885aa0a504906789c006b3cf17a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 18 Sep 2001 06:41:29 +0000 Subject: Correct fix for unaligned memcpy - malloc'ed memory incremented by sizeof(struct locking_data) was not forced to be 8 byte aligned. Use union to force it to be correctly aligned for memcpy and use void *, to tell compiler not to optimize aligned copy (this last fix suggested by Trond @ RedHat). The first fix should be sufficient, but this provides a "belt and braces" fix. Jeremy. (This used to be commit 22c5915bb466529ac1bcb5c2574888b360a9775b) --- source3/include/smb.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/include/smb.h') diff --git a/source3/include/smb.h b/source3/include/smb.h index 85cd042976..abf13533d2 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -652,7 +652,10 @@ struct locking_key { }; struct locking_data { - int num_share_mode_entries; + union { + int num_share_mode_entries; + share_mode_entry dummy; /* Needed for alignment. */ + } u; /* the following two entries are implicit share_mode_entry modes[num_share_mode_entries]; char file_name[]; -- cgit