]> git.decadent.org.uk Git - nfs-utils.git/commit
mount.nfs: Fix sockaddr pointer aliasing in stropts.c
authorChuck Lever <chuck.lever@oracle.com>
Fri, 11 Dec 2009 15:46:06 +0000 (10:46 -0500)
committerSteve Dickson <steved@redhat.com>
Fri, 11 Dec 2009 21:13:16 +0000 (16:13 -0500)
commitb58c5b62ac47f84bca17fc7999e30b0a43ccb92d
tree28d2f076b5f9a212138c449685336c7cc61602c1
parent1f3fae1fb25168aac187ff1881738c8ad53a8763
mount.nfs: Fix sockaddr pointer aliasing in stropts.c

Using a sockaddr_storage and casting a sockaddr pointer to it breaks
C's aliasing rules.

See:

  https://bugzilla.redhat.com/show_bug.cgi?id=448743

Replacing sockaddr_storage makes this code less likely to break when
optimized by gcc.  It also saves a significant amount of stack space
by replacing a 130 byte structure with a union that is less than 32
bytes.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/mount/stropts.c