]> git.ipfire.org Git - thirdparty/ulogd2.git/commit
input: UNIXSOCK: prevent unaligned pointer access
authorJeremy Sowden <jeremy@azazel.net>
Tue, 30 Nov 2021 10:55:38 +0000 (10:55 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 30 Nov 2021 22:05:54 +0000 (23:05 +0100)
commit4958b0bf1221bdf3f7e30ff0fd235eb6321d5efb
tree6bfc50fe4463a28fe37367863509d5fcca72db0e
parent50c34491453db218d44856bd769a478eb6bf42e8
input: UNIXSOCK: prevent unaligned pointer access

`struct ulogd_unixsock_packet_t` is packed, so taking the address of its
`struct iphdr payload` member may yield an unaligned pointer value.  We
only actually dereference the pointer to get the IP version, so replace
the pointer with a version variable and elsewhere use `pkt.payload`
directly.

Remove a couple of stray semicolons.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
input/packet/ulogd_inppkt_UNIXSOCK.c