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 CVE: CVE-2024-36620 Upstream-Status: Backport [https://github.com/moby/moby/commit/ab570ab3d62038b3d26f96a9bb585d0b6095b9b4] Signed-off-by: Praveen Kumar --- daemon/images/image_history.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon/images/image_history.go b/daemon/images/image_history.go index dcf7a906aa..e5adda8639 100644 --- a/daemon/images/image_history.go +++ b/daemon/images/image_history.go @@ -41,10 +41,14 @@ func (i *ImageService) ImageHistory(ctx context.Context, name string) ([]*image. layer.ReleaseAndLog(i.layerStore, l) layerCounter++ } + var created int64 + if h.Created != nil { + created = h.Created.Unix() + } history = append([]*image.HistoryResponseItem{{ ID: "", - Created: h.Created.Unix(), + Created: created, CreatedBy: h.CreatedBy, Comment: h.Comment, Size: layerSize, -- 2.40.0