FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: guard against short paths in changelog GitHub URL redirect by AruneshDwivedi · Pull Request #9689 · updatecli/updatecli · GitHub

fix: guard against short paths in changelog GitHub URL redirect - #9689

Closed
AruneshDwivedi wants to merge 1 commit into
updatecli:mainfrom
AruneshDwivedi:fix/short-changelog-url-panic
Closed

fix: guard against short paths in changelog GitHub URL redirect#9689
AruneshDwivedi wants to merge 1 commit into
updatecli:mainfrom
AruneshDwivedi:fix/short-changelog-url-panic

Conversation

Copy link
Copy Markdown
Contributor

redirectToGitHubRawContent indexed strings.Split(u.Path, "/")[3] without checking the slice length. A github.com changelog URL with fewer than four path segments (e.g. an annotation pointing at https://github.com/CHANGELOG.md) panicked with index out of range and aborted the whole run, since Changelog() calls it for every image advertising such an annotation.

Split once and only rewrite the segment when it exists, leaving short paths untouched. Added a unit test covering the short path and the tree->blob rewrite.

Fixes #9688

redirectToGitHubRawContent indexed strings.Split(u.Path, "/")[3] without
checking the slice length, so a github.com changelog URL with fewer than four
path segments panicked with index out of range and aborted the whole run.

Split once and only rewrite the segment when it exists, leaving short paths
untouched. Added a unit test covering the short path and the tree->blob rewrite.

Fixes updatecli#9688

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>

mergify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

olblak closed this Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL