Skip to content

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

Merged
Luap99 merged 1 commit into
podman-container-tools:mainfrom
ROKUMATE:version-dlocate-bounds
Sep 9, 2026
Merged

Luap99 merged 1 commit into
podman-container-tools:mainfrom
ROKUMATE:version-dlocate-bounds

Conversation

@ROKUMATE

Copy link
Copy Markdown
Contributor

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

@Luap99 Luap99 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Luap99
Luap99 enabled auto-merge September 9, 2026 11:40
@Luap99
Luap99 merged commit 0d12145 into podman-container-tools:main Sep 9, 2026
20 checks passed
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

2 participants