GNU bug report logs - #35814
27.0.50; Broken font display

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Mon, 20 May 2019 21:37:02 UTC

Severity: normal

Found in version 27.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andy Moreton <andrewjmoreton <at> gmail.com>
To: 35814 <at> debbugs.gnu.org
Subject: bug#35814: 27.0.50; Broken font display
Date: Tue, 21 May 2019 20:14:17 +0100
On Tue 21 May 2019, Alex Gramiak wrote:

> Juri Linkov <juri <at> linkov.net> writes:
>
>> Some yesterday's commit in master broke the display of the text that uses
>> the font "-misc-fixed-medium-r-normal--10-*-*-*-c-60-iso10646-*"
>> in GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
>> Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
>> System Description: Linux Mint 19
>>
>> Screenshot:
>
> It's probably due to my a4fe9c70af7 commit, sorry.
>
> I tested with all X font backends -- what's the value of
> (frame-parameter nil 'font-backend) normally?
>
> And is it only that font, or other fonts as well?

Alex, at the end of xfont_draw() in xfont.c, we now have:

      else
        {
          const unsigned code = s->char2b[from];
          const XChar2b char2b = { .byte1 = code >> 8,
                                   .byte2 = code & 0xFF };
          XDrawImageString16 (display, FRAME_X_DRAWABLE (s->f),
                              gc, x, y, &char2b, len);
        }

and:
      else
        {
          const unsigned code = s->char2b[from];
          const XChar2b char2b = { .byte1 = code >> 8,
                                   .byte2 = code & 0xFF };
          XDrawString16 (display, FRAME_X_DRAWABLE (s->f),
                         gc, x, y, &char2b, len);
        }

Both of these pass "len", but use a single XChar2b on the stack, so
this causes an overrun (and draws random stack contents).

    AndyM





This bug report was last modified 5 years and 363 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.