This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch json-schema-gen-path-traversal
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 8254b7f037aaf20059042e138e664c6b97589dac
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Tue Nov 14 14:27:53 2023 +0100

    Use filepath.clean in json-schema-gen command for destination parameter
    
    Signed-off-by: Andrea Cosentino <anco...@gmail.com>
---
 cmd/util/json-schema-gen/main.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cmd/util/json-schema-gen/main.go b/cmd/util/json-schema-gen/main.go
index d5ebe78cd..79633a751 100644
--- a/cmd/util/json-schema-gen/main.go
+++ b/cmd/util/json-schema-gen/main.go
@@ -20,12 +20,12 @@ package main
 import (
        "encoding/json"
        "fmt"
+       "github.com/apache/camel-k/v2/pkg/util"
        "os"
+       "path/filepath"
        "reflect"
        "strings"
 
-       "github.com/apache/camel-k/v2/pkg/util"
-
        apiextensionsv1 
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
        clientscheme "k8s.io/client-go/kubernetes/scheme"
 
@@ -41,7 +41,7 @@ func main() {
        schema := os.Args[2]
        path := os.Args[3]
        isArray := os.Args[4] == "true"
-       destination := os.Args[5]
+       destination := filepath.Clean(os.Args[5])
 
        if err := generate(crd, schema, path, isArray, destination); err != nil 
{
                panic(err)

Reply via email to