]> git.ipfire.org Git - thirdparty/lldpd.git/commit
Avoid dereferencing a type-punned pointer.
authorVincent <bernat@luffy.cx>
Sat, 6 Mar 2010 08:53:40 +0000 (09:53 +0100)
committerVincent <bernat@luffy.cx>
Sat, 6 Mar 2010 09:24:24 +0000 (10:24 +0100)
commit72c00381999c613115c23bbf080a8a18c5a7e691
treeec596c3b9214c68171f4a75222804662190467df
parent9898ac078defbeb73285b90a23bcf5ac344130c0
Avoid dereferencing a type-punned pointer.

When passing a file descriptor, we were dereferencing a unsigned char
pointer. This breaks strict-aliasing rules in C99. Moreover, we should
care about the alignment (even if in this case, this is aligned
because the previous member of the struct is an int). Therefore, we
use memcpy instead.
src/privsep_fdpass.c