Skip to content

Commit 40ea68c

Browse files
committed
issues: escape title when doing regexp match
Without this, a test name that has regex in it could break this search, or even cause roachtest itself to crash. Release note: None
1 parent 3b2c035 commit 40ea68c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/cmd/internal/issues/issues.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ func HelpCommandAsLink(title, href string) func(r *Renderer) {
496496
func filterByPrefixTitleMatch(
497497
result *github.IssuesSearchResult, expectedTitle string,
498498
) []github.Issue {
499-
expectedTitleRegex := regexp.MustCompile(`^` + expectedTitle + `(\s+|$)`)
499+
expectedTitleRegex := regexp.MustCompile(`^` + regexp.QuoteMeta(expectedTitle) + `(\s+|$)`)
500500
var issues []github.Issue
501501
for _, issue := range result.Issues {
502502
if title := issue.Title; title != nil && expectedTitleRegex.MatchString(*title) {

0 commit comments

Comments
 (0)