MCPcopy
hub / github.com/containerd/containerd / checkBlobPath

Function checkBlobPath

contrib/fuzz/content_fuzz_test.go:37–47  ·  view source on GitHub ↗

checkBlobPath performs some basic validation

(dgst digest.Digest, root string)

Source from the content-addressed store, hash-verified

35
36// checkBlobPath performs some basic validation
37func checkBlobPath(dgst digest.Digest, root string) error {
38 if err := dgst.Validate(); err != nil {
39 return err
40 }
41 path := filepath.Join(root, "blobs", dgst.Algorithm().String(), dgst.Encoded())
42 _, err := os.Stat(path)
43 if err != nil {
44 return err
45 }
46 return nil
47}
48
49// generateBlobs is a helper function to create random blobs
50func generateBlobs(f *fuzz.ConsumeFuzzer) (map[digest.Digest][]byte, error) {

Callers 1

FuzzCSWalkFunction · 0.70

Calls 3

StatMethod · 0.65
ValidateMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…