diff options
author | Jeremy Allison <jra@samba.org> | 2001-09-18 06:41:29 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-09-18 06:41:29 +0000 |
commit | 5bc82e443b2da885aa0a504906789c006b3cf17a (patch) | |
tree | 6440822892634cb6e10c373eeea833066ab37a96 /source3/include | |
parent | 36a6611da2820da3635a8158dd26f41732b5b4fd (diff) | |
download | samba-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.h | 5 |
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[]; |