diff options
author | Rich Felker <dalias@aerifal.cx> | 2016-06-09 13:42:06 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2016-06-09 13:42:06 -0400 |
commit | 1e6fc0b690191005a49468c296ad49d0caacacf1 (patch) | |
tree | 58025919ba7a72f208e7e5c244a698caebddf9ab /arch/aarch64/bits/user.h | |
parent | a0bb50a14216e7be7453abee2e7b5830e2a7c4c1 (diff) | |
download | musl-1e6fc0b690191005a49468c296ad49d0caacacf1.tar.gz |
avoid padding gaps in struct sockaddr_storage
compilers are free not to copy, or in some cases to clobber, padding
bytes in a structure. while it's an aliasing violation, and thus
undefined behavior, to copy or manipulate other sockaddr types using
sockaddr_storage, it seems likely that traditional code attempts to do
so, and the original intent of the sockaddr_storage structure was
probably to allow such usage.
in the interest of avoiding silent and potentially dangerous breakage,
ensure that there are no actual padding bytes in sockaddr_storage by
moving and adjusting the size of the __ss_padding member so that it
fits exactly.
this change also removes a silent assumption that the alignment of
long is equal to its size.
Diffstat (limited to 'arch/aarch64/bits/user.h')
0 files changed, 0 insertions, 0 deletions