all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andy Moreton <andrewjmoreton@gmail.com>
To: 35814@debbugs.gnu.org
Subject: bug#35814: 27.0.50; Broken font display
Date: Tue, 21 May 2019 20:14:17 +0100	[thread overview]
Message-ID: <vz1y32zr56e.fsf@gmail.com> (raw)
In-Reply-To: <87d0kcvmj0.fsf@mail.linkov.net>

On Tue 21 May 2019, Alex Gramiak wrote:

> Juri Linkov <juri@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






  parent reply	other threads:[~2019-05-21 19:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20 21:33 bug#35814: 27.0.50; Broken font display Juri Linkov
2019-05-21  6:01 ` Alex Gramiak
2019-05-21  8:03   ` Katsumi Yamaoka
2019-05-21 19:14   ` Andy Moreton [this message]
2019-05-21 21:19     ` Alex Gramiak
2019-05-21 21:42       ` Juri Linkov
2019-05-21 19:41   ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vz1y32zr56e.fsf@gmail.com \
    --to=andrewjmoreton@gmail.com \
    --cc=35814@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.