Fixes calling smtp_char_is_qpair() with ubsan:
runtime error: implicit conversion from type 'char' of value -61 (8-bit, signed) to type 'unsigned char' changed the value to 195 (8-bit, unsigned)
int smtp_address_init_from_msg(struct smtp_address *address,
const struct message_address *msg_addr)
{
- const char *p;
+ const unsigned char *p;
i_zero(address);
if (msg_addr->mailbox == NULL || *msg_addr->mailbox == '\0')
/* The message_address_parse() function allows UTF-8 codepoints in
the localpart. For SMTP addresses that is not an option, so we
need to check this upon conversion. */
- for (p = msg_addr->mailbox; *p != '\0'; p++) {
+ for (p = (const unsigned char *)msg_addr->mailbox; *p != '\0'; p++) {
if (!smtp_char_is_qpair(*p))
return -1;
}