]> git.ipfire.org Git - thirdparty/hostap.git/commit
Fix gcc-10 build with -Werror=array-bounds and dl_list_for_each()
authorJouni Malinen <j@w1.fi>
Fri, 4 Dec 2020 11:45:03 +0000 (13:45 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 4 Dec 2020 11:59:37 +0000 (13:59 +0200)
commitbba926350a0e28fa181af7caee24a11619ad10fc
tree2cce3851f679e747a5369553b9334db695663f25
parentd215f42538289c230c015550bc4efb4586c208b2
Fix gcc-10 build with -Werror=array-bounds and dl_list_for_each()

The earlier workaround for UBSAN issues in commit 3b6b3ae58133 ("Modify
dl_list_for_each() to not use unaligned access with WPA_TRACE") ended up
using a construction in which the type cast to the containing structure
was compared instead of the struct dl_list pointers. While that worked
around the UBSAN issue, it resulted in a comparison that gcc-10
interprets as being out of bounds for struct dl_list (which it obviously
is since this is to find the start of the containing structure).

Revert that workaround and instead, mark the struct dl_list used within
struct os_alloc_trace to have matching 16 octet alignment as the
containing structure. This is also restoring consistent design for
dl_list_for_each*().

Signed-off-by: Jouni Malinen <j@w1.fi>
src/utils/list.h
src/utils/os_unix.c