Skip to content

pkg/version: fix index out of range when parsing dlocate output - #1076

Open
ROKUMATE wants to merge 1 commit into
podman-container-tools:mainfrom
ROKUMATE:version-dlocate-bounds
Open

pkg/version: fix index out of range when parsing dlocate output#1076
ROKUMATE wants to merge 1 commit into
podman-container-tools:mainfrom
ROKUMATE:version-dlocate-bounds

Conversation

@ROKUMATE

Copy link
Copy Markdown

Fixes: #1075

The bound allowed len(f) == 2 but the code indexes f[2].

queryPackageVersion shells out, so the line parsing is split into parseDlocateList
to make it testable. Malformed output now falls through to the existing return instead
of panicking; well-formed output parses identically.

The output shadowing in version.go is a separate concern and left alone.

Fixes: podman-container-tools#1075

Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
@github-actions github-actions Bot added the common Related to "common" package label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to "common" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pkg/version: index out of range parsing dlocate output

1 participant