commit 1462d68eb6a4ec9ff95c785ead08a492f395e80b
parent fcd5b8b54f7efbda63341574e54fefcc72c2615d
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Sat, 20 Apr 2019 22:28:58 +0200
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.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/tools/test-runner.c b/tools/test-runner.c
@@ -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++) {