From 1462d68eb6a4ec9ff95c785ead08a492f395e80b Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Sat, 20 Apr 2019 22:28:58 +0200 Subject: [PATCH] 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. --- tools/test-runner.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/test-runner.c b/tools/test-runner.c index bd5f687a..fb1af04b 100644 --- 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++) {