3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-29 05:39:24 +01:00

test-runner: Check radio_conf_list is not null

The option may be present but may not parse correctly as a list in which
case has_hw_conf will be true but radio_conf_list will be NULL and we
might crash.
This commit is contained in:
Andrew Zaborowski 2019-04-20 22:28:58 +02:00 committed by Denis Kenzior
parent fcd5b8b54f
commit 1462d68eb6

View File

@ -1035,6 +1035,10 @@ static bool configure_hw_radios(struct l_settings *hw_settings,
l_settings_get_string_list(hw_settings, HW_CONFIG_GROUP_SETUP, l_settings_get_string_list(hw_settings, HW_CONFIG_GROUP_SETUP,
HW_CONFIG_SETUP_RADIO_CONFS, HW_CONFIG_SETUP_RADIO_CONFS,
':'); ':');
if (has_hw_conf && !radio_conf_list) {
l_error("%s doesn't parse", HW_CONFIG_SETUP_RADIO_CONFS);
return false;
}
if (has_hw_conf) { if (has_hw_conf) {
for (i = 0; radio_conf_list[i]; i++) { for (i = 0; radio_conf_list[i]; i++) {