mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
f11e797d4c
It looks like both gcc and clang optimize the (entry.type != foo || entry.array_type != bar) in a way that ends up evaluating the second condition even when the first one results in 0. While this is not really what the C language requirements on short-circuit evaluation require, the compiler likely assumes this can have no side effects and with both type and array_type being comparable in a single 64-bit operation, this can clearly be a bit more efficient. While the code behaves same in both cases, valgrind does warn about use of uninitialized memory when the second condition is evaluated (entry.array_type is not initialized if entry.type != DBUS_TYPE_ARRAY). To keep valgrind logs cleaner, initialize entry.array_type to DBUS_TYPE_INVALID so that these compiler optimizations do not result in reading uninitialized memory. Signed-off-by: Jouni Malinen <j@w1.fi> |
||
---|---|---|
.. | ||
.gitignore | ||
dbus_common_i.h | ||
dbus_common.c | ||
dbus_common.h | ||
dbus_dict_helpers.c | ||
dbus_dict_helpers.h | ||
dbus_new_handlers_p2p.c | ||
dbus_new_handlers_p2p.h | ||
dbus_new_handlers_wps.c | ||
dbus_new_handlers.c | ||
dbus_new_handlers.h | ||
dbus_new_helpers.c | ||
dbus_new_helpers.h | ||
dbus_new_introspect.c | ||
dbus_new.c | ||
dbus_new.h | ||
dbus_old_handlers_wps.c | ||
dbus_old_handlers.c | ||
dbus_old_handlers.h | ||
dbus_old.c | ||
dbus_old.h | ||
dbus-wpa_supplicant.conf | ||
fi.epitest.hostap.WPASupplicant.service.in | ||
fi.w1.wpa_supplicant1.service.in | ||
Makefile |