0x01-0x1F and 0x7f-... must be mBASE64 encoded.
Signed-off-by: Phil Carmody <phil@dovecot.fi>
const char *p;
for (p = str; *p != '\0'; p++) {
- if (*p == '&' || (unsigned char)*p >= 0x80)
+ if (*p == '&' || *p < 0x20 || *p >= 0x7f)
return p;
}
return NULL;
p++;
continue;
}
- if ((unsigned char)*p < 0x80) {
+ if (*p >= 0x20 && *p < 0x7f) {
str_append_c(dest, *p);
p++;
continue;
}
u = utf16;
- while ((unsigned char)*p >= 0x80) {
+ while (*p != '\0' && (*p < 0x20 || *p >= 0x7f)) {
if (uni_utf8_get_char(p, &chr) <= 0)
return -1;
/* @UNSAFE */