Skip to content

Commit

Permalink
fix(GODT-2587): Fix infinite loop in RFC5322 Domain Specifier
Browse files Browse the repository at this point in the history
  • Loading branch information
LBeernaertProton committed Apr 25, 2023
1 parent dfde413 commit 8ec759b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rfc5322/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,8 @@ func isDText(tokenType rfcparser.TokenType) bool {
if rfcparser.IsCTL(tokenType) ||
tokenType == rfcparser.TokenTypeLBracket ||
tokenType == rfcparser.TokenTypeRBracket ||
tokenType == rfcparser.TokenTypeBackslash {
tokenType == rfcparser.TokenTypeBackslash ||
tokenType == rfcparser.TokenTypeEOF {
return false
}

Expand Down
5 changes: 5 additions & 0 deletions rfc5322/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -852,3 +852,8 @@ func TestParserAddressEmailValidation(t *testing.T) {
})
}
}

func TestParse_GODT_2587_infinite_loop(t *testing.T) {
_, err := ParseAddressList("00@[000000000000000")
assert.Error(t, err)
}

0 comments on commit 8ec759b

Please sign in to comment.