* grub-core/normal/charset.c (grub_utf8_to_utf16): Handle 6- and 7-byte sequences as incorrect. (grub_is_valid_utf8): Likewise. (grub_utf8_to_ucs4): Likewise. (grub_ucs4_to_utf8): Handle codepoints outside of BMP. (grub_ucs4_to_utf8_alloc): Likewise. * include/grub/charset.h (grub_utf16_to_utf8): Likewise.
on malloc error. (grub_bidi_logical_to_visual): Check that malloc succeded. * grub-core/normal/term.c (grub_puts_terminal): Fix fallback to dumb puts. (grub_xputs_normal): Likewise.