validate-scenario: Initialize variable correctly

ret needs to be always reset to FALSE *before* checking attempting to load the
individual files. Otherwise there's the possibility it would silently accept an
invalid scenario name

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/196>
This commit is contained in:
Edward Hervey 2020-05-22 18:00:04 +02:00 committed by Edward Hervey
parent 8697663d8c
commit 5e2df60422

View file

@ -3800,7 +3800,7 @@ gst_validate_scenario_load (GstValidateScenario * scenario,
{
gchar **scenarios = NULL;
guint i;
gboolean found_actions = FALSE, is_config, ret = TRUE;
gboolean found_actions = FALSE, is_config, ret = FALSE;
gchar **include_paths = gst_validate_scenario_get_include_paths (NULL);
if (!scenario_name)
@ -3812,6 +3812,8 @@ gst_validate_scenario_load (GstValidateScenario * scenario,
guint include_i;
gchar *lfilename = NULL, *tldir = NULL, *scenario_file = NULL;
ret = FALSE;
/* First check if the scenario name is not a full path to the
* actual scenario */
if (g_file_test (scenarios[i], G_FILE_TEST_IS_REGULAR)) {