[go] cmd/go: check pattern for utf8 validity before call regexp.MustCompile

0 views
Skip to first unread message

Michael Matloob (Gerrit)

unread,
Sep 16, 2025, 3:31:30 PM (5 days ago) Sep 16
to Youlin Feng, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Ian Alexander, Michael Matloob, Go LUCI, Sam Thanawalla, golang-co...@googlegroups.com

Michael Matloob submitted the change

Change information

Commit message:
cmd/go: check pattern for utf8 validity before call regexp.MustCompile

Do not panic if the package path or the package version contains
invalid UTF-8 characters.

Fixes #75251
Change-Id: Ib787e74277cf814253857b911d378ea5e53d8824
Reviewed-by: Michael Matloob <mat...@google.com>
Reviewed-by: Ian Alexander <ji...@google.com>
Reviewed-by: Michael Matloob <mat...@golang.org>
Files:
  • M src/cmd/go/internal/modget/query.go
  • A src/cmd/go/testdata/script/get_panic_issue75251.txt
  • M src/cmd/internal/pkgpattern/pkgpattern.go
Change size: S
Delta: 3 files changed, 24 insertions(+), 1 deletion(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Michael Matloob, +1 by Ian Alexander, +2 by Michael Matloob
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ib787e74277cf814253857b911d378ea5e53d8824
Gerrit-Change-Number: 700815
Gerrit-PatchSet: 10
Gerrit-Owner: Youlin Feng <fengy...@live.com>
Gerrit-Reviewer: Ian Alexander <ji...@google.com>
Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
Gerrit-Reviewer: Michael Matloob <mat...@google.com>
Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
Gerrit-Reviewer: Youlin Feng <fengy...@live.com>
Gerrit-CC: Sean Liao <se...@liao.dev>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages