]> The Tcpdump Group git mirrors - tcpdump/commit
Move safememcpy() to util.c so it doesn't get inlined.
authorGuy Harris <[email protected]>
Thu, 16 Jan 2014 02:12:06 +0000 (18:12 -0800)
committerGuy Harris <[email protected]>
Thu, 16 Jan 2014 02:12:06 +0000 (18:12 -0800)
commit00cef632b48468bec911c7c66f4812ab36cad4bb
tree42439f854c0eb5dad60e160956b40cfb0a40009b
parent243902ad36a6749e14e2286168a9ad44812d2f1f
Move safememcpy() to util.c so it doesn't get inlined.

It appears that some C compilers will inline safememcpy() *and* will, as
a result, optimize to assume alignment it if it's passed a
putatively-aligned pointer. As the pointers in question are not
guaranteed to be aligned, that can cause crashes on, for example, SPARC.

Also, rename the function to unaligned_memcpy(), to clarify what's
"safe" about it, and change some direct memcpy() calls to use it as
well.
interface.h
netdissect.h
print-isakmp.c
util.c