File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,15 +22,25 @@ import (
2222 "os"
2323
2424 fuzz "github.com/AdaLogics/go-fuzz-headers"
25+ "github.com/sirupsen/logrus"
2526
2627 "github.com/containerd/containerd/archive"
2728 "github.com/containerd/containerd/content/local"
2829 imageArchive "github.com/containerd/containerd/images/archive"
30+ "github.com/containerd/containerd/log"
2931)
3032
3133// FuzzApply implements a fuzzer that applies
3234// a fuzzed tar archive on a directory
3335func FuzzApply (data []byte ) int {
36+ ctx := context .Background ()
37+
38+ // Apply() is logging the below message, which is too noisy and not really useful
39+ // if the input is random.
40+ //
41+ // level=warning msg="ignored xattr ... in archive" error="operation not supported"
42+ log .G (ctx ).Logger .SetLevel (logrus .PanicLevel )
43+
3444 f := fuzz .NewConsumer (data )
3545 iters , err := f .GetInt ()
3646 if err != nil {
@@ -48,7 +58,7 @@ func FuzzApply(data []byte) int {
4858 return 0
4959 }
5060 r := bytes .NewReader (rBytes )
51- _ , _ = archive .Apply (context . Background () , tmpDir , r )
61+ _ , _ = archive .Apply (ctx , tmpDir , r )
5262 }
5363 return 1
5464}
You can’t perform that action at this time.
0 commit comments