containerd/patch/0112-containerd-cio-FIFOSet.Close-check-if-FIFOSet-is-nill-to-preven.patch

27 lines
702 B
Diff
Raw Normal View History

From 38f756e73afaedae43d5d53e4731cf9ea45b8e5d Mon Sep 17 00:00:00 2001
From: Sebastiaan van Stijn <github@gone.nl>
Date: Thu, 29 Feb 2024 19:52:14 +0800
Subject: [PATCH] cio: FIFOSet.Close() check if FIFOSet is nill to prevent NPE
Reference:https://github.com/containerd/containerd/commit/6a2d3990d1db676935ea7d1d2f8e2b952998b5d9
---
cio/io.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cio/io.go b/cio/io.go
index bda04d2..dcf40aa 100644
--- a/cio/io.go
+++ b/cio/io.go
@@ -77,7 +77,7 @@ type FIFOSet struct {
// Close the FIFOSet
func (f *FIFOSet) Close() error {
- if f.close != nil {
+ if f != nil && f.close != nil {
return f.close()
}
return nil
--
2.33.0