1
0

GODT-1263: Fix crash on invalid or empty header

This commit is contained in:
Alexander Bilyak
2021-08-27 13:39:34 +00:00
parent b8dd9f82bd
commit f10da3c7f0
6 changed files with 183 additions and 2 deletions

View File

@ -347,6 +347,12 @@ func writeMultipartEncryptedRFC822(header message.Header, body []byte) ([]byte,
return nil, err
}
// If parsed header is empty then either it is malformed or it is missing.
// Anyway message could not be considered multipart/mixed anymore since there will be no boundary.
if bodyHeader.Len() == 0 {
header.Del("Content-Type")
}
entFields := bodyHeader.Fields()
for entFields.Next() {