CodeQL: Try to fix uncontrolled data used in path expression (#43462)

Ref #43080
This commit is contained in:
Marcus Efraimsson
2022-01-11 17:37:58 +01:00
committed by GitHub
parent 2a766c6a04
commit f6414ea2b2
4 changed files with 97 additions and 3 deletions

View File

@ -144,6 +144,17 @@ type JSONData struct {
Executable string `json:"executable,omitempty"`
}
func (d JSONData) DashboardIncludes() []*Includes {
result := []*Includes{}
for _, include := range d.Includes {
if include.Type == TypeDashboard {
result = append(result, include)
}
}
return result
}
// Route describes a plugin route that is defined in
// the plugin.json file for a plugin.
type Route struct {