Skip to content

Commit 6c0ad89

Browse files
committed
email_lib: encode LF-only newlines for vcard
References: GXH-120
1 parent 7a60d78 commit 6c0ad89

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/email/vcard.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,14 @@ static size_t vcard_serialize_string(char *pbuff,
409409
if (line_offset >= 0)
410410
line_offset += 2;
411411
continue;
412+
} else if (string[i] == '\n') {
413+
if (offset + 1 >= max_length)
414+
return max_length;
415+
pbuff[offset++] = '\\';
416+
pbuff[offset++] = 'n';
417+
if (line_offset >= 0)
418+
line_offset += 2;
419+
continue;
412420
}
413421
pbuff[offset++] = string[i];
414422
if (line_offset >= 0)

0 commit comments

Comments
 (0)