Skip to content

Commit

Permalink
email_lib: encode LF-only newlines for vcard
Browse files Browse the repository at this point in the history
References: GXH-120
  • Loading branch information
jengelh committed Jan 1, 2025
1 parent 7a60d78 commit 6c0ad89
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/email/vcard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,14 @@ static size_t vcard_serialize_string(char *pbuff,
if (line_offset >= 0)
line_offset += 2;
continue;
} else if (string[i] == '\n') {
if (offset + 1 >= max_length)
return max_length;
pbuff[offset++] = '\\';
pbuff[offset++] = 'n';
if (line_offset >= 0)
line_offset += 2;
continue;
}
pbuff[offset++] = string[i];
if (line_offset >= 0)
Expand Down

0 comments on commit 6c0ad89

Please sign in to comment.