From 1da5b2c60b6ad3747046cbe9060d35a6d110a97c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 30 Jul 2021 21:17:58 +0300 Subject: [PATCH] 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) --- src/fontset.c | 3 +++ 1 file changed, 3 insertions(+) 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)) -- 2.39.2