Skip to content

Commit e1d305a

Browse files
committed
check payload len [squash]
1 parent 83645ef commit e1d305a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fat_error_encrypt.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ func (o *OnionFatErrorEncrypter) addHmacs(data []byte) {
7272
func (o *OnionFatErrorEncrypter) EncryptError(initial bool, data []byte,
7373
payload []byte) ([]byte, error) {
7474

75+
if len(payload) > o.payloadDataLen {
76+
return nil, fmt.Errorf("payload exceeds maximum length")
77+
}
78+
7579
if initial {
7680
if len(data) < minOnionErrorLength {
7781
return nil, fmt.Errorf(

0 commit comments

Comments
 (0)