From: Eli Zaretskii Date: Fri, 30 Jul 2021 18:17:58 +0000 (+0300) Subject: Avoid segfault when set-fontset-font is called from non-GUI frames X-Git-Tag: emacs-28.0.90~1641 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1da5b2c60b6ad3747046cbe9060d35a6d110a97c;p=emacs.git Avoid segfault when set-fontset-font is called from non-GUI frames * src/fontset.c (check_fontset_name): Avoid crashes if this is called from a non-GUI frame. (Bug#49782) --- diff --git a/src/fontset.c b/src/fontset.c index 332be6c39d1..52c7e381e15 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -1356,6 +1356,9 @@ check_fontset_name (Lisp_Object name, Lisp_Object *frame) int id; struct frame *f = decode_live_frame (*frame); + if (!FRAME_WINDOW_P (f)) + error ("Can't use fontsets in non-GUI frames"); + XSETFRAME (*frame, f); if (EQ (name, Qt))