Skip to content

fix: avoid panic on malformed external issue tracker URL format - #8312

Merged
unknwon merged 3 commits into
mainfrom
GHSA-4j89-2c4f-44c6
Jun 3, 2026
Merged

unknwon merged 3 commits into
mainfrom
GHSA-4j89-2c4f-44c6

Conversation

@unknwon

@unknwon unknwon commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Replace the unsafe com.Expand call in RenderIssueIndexPattern with a local helper that tolerates unbalanced { in the format template.
  • A malformed external issue tracker URL format would otherwise crash the rendering pipeline, leaving pages that contain issue references unavailable.
  • Adds a regression test that exercises the malformed-format path.

Refs GHSA-4j89-2c4f-44c6.

Test plan

  • moon run gogs:lint
  • moon run gogs:build
  • go test -race ./internal/markup/...

@unknwon
unknwon force-pushed the GHSA-4j89-2c4f-44c6 branch from 64c53bb to 8e28a46 Compare June 3, 2026 02:45
@unknwon unknwon added this to the 0.14.3 milestone Jun 3, 2026
@unknwon
unknwon merged commit 0529d95 into main Jun 3, 2026
8 checks passed
@unknwon
unknwon deleted the GHSA-4j89-2c4f-44c6 branch June 3, 2026 02:50
unknwon added a commit that referenced this pull request Jun 7, 2026
unknwon added a commit that referenced this pull request Jun 7, 2026
#8312 dropped the import on main where unknwon/com was already replaced
project-wide (#8148). That refactor is not part of the 0.14.3 backport,
so the package is still in use on release/0.14 and the import must stay.
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