45ac5793fc
There are a few instances where dbus handlers test the value of errno to test whether strtoul completes successfully. Since strtoul does not clear errno, and there's no strong reason to suspect that errno is already clear, it is safer to clear it right before calling strtoul. Also, any failure in strtoul (setting errno non-zero) should be considered a failure. While testing using dbus-send, I found that a malformed network path can cause a crash due to net_id being left NULL. We should test for this before calling strtoul on it. Tested with: dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \ /fi/w1/wpa_supplicant1/Interfaces/0 \ org.freedesktop.DBus.Properties.Get \ string:fi.w1.wpa_supplicant1.Interface string:Networks dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \ /fi/w1/wpa_supplicant1/Interfaces/0 \ fi.w1.wpa_supplicant1.Interface.RemoveNetwork \ objpath:/fi/w1/wpa_supplicant1/Interfaces/0/Networks/0 dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \ /fi/w1/wpa_supplicant1/Interfaces/0 \ fi.w1.wpa_supplicant1.Interface.RemoveNetwork \ objpath:/fi/w1/wpa_supplicant1/Interfaces/0/Networks/0 dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \ /fi/w1/wpa_supplicant1/Interfaces/0 \ fi.w1.wpa_supplicant1.Interface.RemoveNetwork \ objpath:/fi/w1/wpa_supplicant1/Interfaces/0 Signed-hostap: Paul Stewart <pstew@chromium.org> intended-for: hostap-1 |
||
---|---|---|
.. | ||
.gitignore | ||
dbus-wpa_supplicant.conf | ||
dbus_common.c | ||
dbus_common.h | ||
dbus_common_i.h | ||
dbus_dict_helpers.c | ||
dbus_dict_helpers.h | ||
dbus_new.c | ||
dbus_new.h | ||
dbus_new_handlers.c | ||
dbus_new_handlers.h | ||
dbus_new_handlers_p2p.c | ||
dbus_new_handlers_p2p.h | ||
dbus_new_handlers_wps.c | ||
dbus_new_helpers.c | ||
dbus_new_helpers.h | ||
dbus_new_introspect.c | ||
dbus_old.c | ||
dbus_old.h | ||
dbus_old_handlers.c | ||
dbus_old_handlers.h | ||
dbus_old_handlers_wps.c | ||
fi.epitest.hostap.WPASupplicant.service.in | ||
fi.w1.wpa_supplicant1.service.in | ||
Makefile |