Skip to content

fix(searchutil): nil-guard ResultItem.ToArtifact against nil receiver#1339

Open
SAY-5 wants to merge 1 commit into
jfrog:masterfrom
SAY-5:fix/resultitem-toartifact-nil-receiver-jfrog-cli-3450
Open

fix(searchutil): nil-guard ResultItem.ToArtifact against nil receiver#1339
SAY-5 wants to merge 1 commit into
jfrog:masterfrom
SAY-5:fix/resultitem-toartifact-nil-receiver-jfrog-cli-3450

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented Apr 23, 2026

Addresses the downstream crash reported at jfrog/jfrog-cli#3450.

Multi-arch container push callers in jfrog-cli-artifactory (OCI buildinfo.createPushBuildProperties) reach ToArtifact on a nil *ResultItem when the manifest-digest SHA lookup misses in Artifactory. The direct item.Name deref crashes the build with:

panic: runtime error: invalid memory address or nil pointer dereference
artifactory/services/utils.(*ResultItem).ToArtifact(0x0) searchutil.go:580 +0x42

…and takes the Jenkins build down.

Fix

Return a zero-value buildinfo.Artifact when item is nil so callers see an empty record and can treat it as "no matching artifact" upstream, rather than fatally panicking the process.

go build ./artifactory/services/utils/... clean.

Multi-arch container push callers in jfrog-cli-artifactory (OCI
buildinfo.createPushBuildProperties) reach ToArtifact on a nil
*ResultItem when the manifest-digest SHA lookup misses in
Artifactory. The direct item.Name deref crashed the build with
'invalid memory address or nil pointer dereference' and took the
entire jenkins build down.

Return a zero-value buildinfo.Artifact when item is nil so callers
see an empty record and can handle it as 'no matching artifact'
upstream, rather than fatally panicking the process.

Refs jfrog/jfrog-cli issue 3450.

Signed-off-by: SAY-5 <say.apm35@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@SAY-5
Copy link
Copy Markdown
Author

SAY-5 commented Apr 30, 2026

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant