Later Base64 parsing would catch that, but command parser errors become clearer
when this is caught early. Also, this fixes a unit test failure when
experimental SMTPUTF8 support is enabled.
When SMTPUTF8 support is disabled, smtp_char_is_textstr() disallows 8-bit
implicitly, but when SMTPUTF8 is enabled 8-bit octets will be let through.
This caused the invalidity unit test to fail.
while (p < parser->end) {
unichar_t ch;
- if (parser->auth_response)
+ if (parser->auth_response) {
+ if ((*p & 0x80) != 0x00)
+ break;
ch = *p;
- else {
+ } else {
nch = uni_utf8_get_char_n(p, (size_t)(parser->end - p),
&ch);
}