moby/1011-fix-CVE-2024-36620.patch
Funda Wang f9bd2cb7df fix CVE-2024-36620, CVE-2024-36621, CVE-2024-36623
(cherry picked from commit c0b254900730351d4f70590eb6692ae88c4523ab)
2024-12-02 10:22:17 +08:00

34 lines
1.1 KiB
Diff

From ab570ab3d62038b3d26f96a9bb585d0b6095b9b4 Mon Sep 17 00:00:00 2001
From: Christopher Petito <47751006+krissetto@users.noreply.github.com>
Date: Fri, 19 Apr 2024 10:44:30 +0000
Subject: [PATCH] nil dereference fix on image history Created value
Issue was caused by the changes here https://github.com/moby/moby/pull/45504
First released in v25.0.0-beta.1
Signed-off-by: Christopher Petito <47751006+krissetto@users.noreply.github.com>
---
daemon/images/image_history.go | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/daemon/images/image_history.go b/daemon/images/image_history.go
index 1617f8be62906..f621ceae13bc6 100644
--- a/daemon/images/image_history.go
+++ b/daemon/images/image_history.go
@@ -43,9 +43,14 @@ func (i *ImageService) ImageHistory(ctx context.Context, name string) ([]*image.
layerCounter++
}
+ var created int64
+ if h.Created != nil {
+ created = h.Created.Unix()
+ }
+
history = append([]*image.HistoryResponseItem{{
ID: "<missing>",
- Created: h.Created.Unix(),
+ Created: created,
CreatedBy: h.CreatedBy,
Comment: h.Comment,
Size: layerSize,