Skip to content

Commit

Permalink
fix(logic): check scheme on wasm fs
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Mar 15, 2023
1 parent 87e0034 commit a6f522b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/logic/interpreter/fs/wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ func (w WasmFS) Scheme() string {
func (w WasmFS) Open(ctx context.Context, uri *url.URL) ([]byte, error) {
sdkCtx := sdk.UnwrapSDKContext(ctx)

if uri.Scheme != scheme {
return nil, fmt.Errorf("invalid scheme")
}

paths := strings.SplitAfter(uri.Opaque, ":")
pathsLen := len(paths)
if pathsLen < 1 || paths[pathsLen-1] == "" {
Expand Down

0 comments on commit a6f522b

Please sign in to comment.