Skip to content

Commit

Permalink
Fix null pointer dereference when no mount configuration is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
EdSchouten committed Aug 21, 2024
1 parent c191faa commit 58ffbe3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/filesystem/virtual/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ func (m *nfsv4Mount) Expose(terminationGroup program.Group, rootDirectory virtua
// specified in a configuration message and starts processing of
// incoming requests.
func NewMountFromConfiguration(configuration *pb.MountConfiguration, fsName string, rootDirectoryAttributeCaching, childDirectoriesAttributeCaching, leavesAttributeCaching AttributeCachingDuration) (Mount, virtual.StatefulHandleAllocator, error) {
if configuration == nil {
return nil, nil, status.Error(codes.InvalidArgument, "No mount configuration provided")
}

switch backend := configuration.Backend.(type) {
case *pb.MountConfiguration_Fuse:
handleAllocator := virtual.NewFUSEHandleAllocator(random.FastThreadSafeGenerator)
Expand Down

0 comments on commit 58ffbe3

Please sign in to comment.