Merge pull request #3579 from milosgajdos/fix-fuzzer
Fix: Avoid a false type assertion in the inmemory driver
This commit is contained in:
commit
c6945a972a
@ -244,11 +244,16 @@ func (d *dir) delete(p string) error {
|
|||||||
return errNotExists
|
return errNotExists
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := parent.(*dir).children[filename]; !ok {
|
parentDir, ok := parent.(*dir)
|
||||||
|
if !ok {
|
||||||
|
return errIsNotDir
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, ok := parentDir.children[filename]; !ok {
|
||||||
return errNotExists
|
return errNotExists
|
||||||
}
|
}
|
||||||
|
|
||||||
delete(parent.(*dir).children, filename)
|
delete(parentDir.children, filename)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user