From 5e2df6042265c5e0ecdda2467a8f9c83ca431ea0 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 22 May 2020 18:00:04 +0200 Subject: [PATCH] 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: --- validate/gst/validate/gst-validate-scenario.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index 91013d5b61..80f63c34dd 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -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)) {