summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-09-18 06:41:29 +0000
committerJeremy Allison <jra@samba.org>2001-09-18 06:41:29 +0000
commit5bc82e443b2da885aa0a504906789c006b3cf17a (patch)
tree6440822892634cb6e10c373eeea833066ab37a96 /source3/include
parent36a6611da2820da3635a8158dd26f41732b5b4fd (diff)
downloadsamba-5bc82e443b2da885aa0a504906789c006b3cf17a.tar.gz
samba-5bc82e443b2da885aa0a504906789c006b3cf17a.tar.bz2
samba-5bc82e443b2da885aa0a504906789c006b3cf17a.zip
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)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/smb.h5
1 files changed, 4 insertions, 1 deletions
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[];