Skip to content

Commit

Permalink
event: remove infinite recursion in compactionAnnotations.SafeFormat
Browse files Browse the repository at this point in the history
We have an infinite recursion where we try to repeatedly call
SafeFormat on compactionAnnotations, as we pass the unmodified
ca variable as-is to redact.Safe. This change addresses that by
breaking up the []string and formatting it individually.
  • Loading branch information
itsbilal committed Sep 7, 2023
1 parent 2129a6e commit 6f6852d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion event.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ func (ca compactionAnnotations) SafeFormat(w redact.SafePrinter, _ rune) {
if len(ca) == 0 {
return
}
w.Printf("%s ", redact.Safe(ca))
for i := range ca {
if i != 0 {
w.Print(" ")
}
w.Printf("%s", redact.SafeString(ca[i]))
}
}

func (i CompactionInfo) String() string {
Expand Down

0 comments on commit 6f6852d

Please sign in to comment.