screen-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [screen-devel] [bug #60030] Screen segfaults by displaying some UTF-


From: Axel Beckert
Subject: Re: [screen-devel] [bug #60030] Screen segfaults by displaying some UTF-8 character combination
Date: Wed, 10 Feb 2021 15:31:21 +0100
User-agent: NeoMutt/20170113 (1.7.2)

Hi Michael,

On Wed, Feb 10, 2021 at 08:59:15AM -0500, Michael Schröder wrote:
> diff --git a/src/encoding.c b/src/encoding.c
> index 11c3c41..e1ea364 100644
> --- a/src/encoding.c
> +++ b/src/encoding.c
> @@ -1164,7 +1164,9 @@ void utf8_handle_comb(unsigned int c, struct mchar *mc)
>                 if (c1 >= 0xd800 && c1 < 0xe000)
>                         comb_tofront(root, c1 - 0xd800);
>                 i = combchars[root]->prev;
> -               if (c1 == i + 0xd800) {
> +               if (i == (unsigned int)root)
> +                       i = combchars[root ^ 1]->prev;  /* steal from other
> root */
> +               if (i == 0x800 || i == 0x801 || c1 == i + 0xd800) {
>                         /* completely full, can't recycle */
>                         mc->image = '?';
>                         mc->font = 0;

Thanks, but this seems to break the actual output.

With that patch I now get "ÿ " after every wide character in the
output. The beginning now looks like this for me (in the hope it will
be passed properly through mail):

円ᆆᆿÿ 忿ᇎᆿÿ 忘ᆿᆿÿ 忿ᆾᆿÿ 応ᆿᆿÿ 忿ᆷᆿÿ 忑ᆿᆿÿ 忿ᇠᆿÿ 冺ᆿᆿÿ 忿ᇇᆿÿ 忟ᆿᆿÿ 忿ᆺᆿÿ 忳ᆿᆿÿ 忿ᅳᆿÿ 忣ᆿᆿÿ 忿ᇯᆿÿ 
忇ᆿᆿÿ 忿ᇅᆿÿ

Which reminds me a lot of
https://savannah.gnu.org/bugs/index.php?31336 aka
https://bugs.debian.org/600246 but made worse.

                Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe@debian.org>, https://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-    |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]