Skip to content

Commit b014b7c

Browse files
committed
fix(BRIDGE-394): prevent literal mutation when using rfc822 parser
1 parent 37666f3 commit b014b7c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

rfc822/parser.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ type Section struct {
2424
}
2525

2626
func Parse(literal []byte) *Section {
27-
return parse(literal, []int{}, 0, len(literal))
27+
literalCopy := make([]byte, len(literal))
28+
copy(literalCopy, literal)
29+
return parse(literalCopy, []int{}, 0, len(literal))
2830
}
2931

3032
func (section *Section) Identifier() []int {

0 commit comments

Comments
 (0)