]> git.ipfire.org Git - thirdparty/hostap.git/commit
Modify dl_list_for_each() to not use unaligned access with WPA_TRACE
authorJouni Malinen <j@w1.fi>
Sat, 23 Feb 2019 10:07:21 +0000 (12:07 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 25 Feb 2019 17:42:34 +0000 (19:42 +0200)
commit3b6b3ae5813329fa69d86a553ff263bc17e8b41b
tree82af455c08f84fb6deec96cea16a32f6c6bab33d
parent1415d4b82d5eab4c8edf2c2b32200137ae0178c3
Modify dl_list_for_each() to not use unaligned access with WPA_TRACE

UBSan testing with WPA_TRACE=y ended up hitting an unaligned access for
struct os_alloc_trace in os_program_deinit() because of the
dl_list_for_each() design that looked like dereferencing the member
element of the list head which is something that does not exist.

Get the first entry from the list using dl_list_first() so that the
empty list special case is covefred and compare item pointers instead of
struct dl_list pointers to check whether the end of the loop has been
reached.

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