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
1 changed files with 4 additions and 0 deletions

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,
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) {
for (i = 0; radio_conf_list[i]; i++) {