From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems Date: Wed, 16 Feb 2022 16:05:34 +0200 Message-ID: <834k4y3o0h.fsf@gnu.org> References: <83czjqrkew.fsf@gnu.org> <874k52kiu4.fsf@yahoo.com> <837d9yribj.fsf@gnu.org> <87v8xii83e.fsf@yahoo.com> <83r186p1h8.fsf@gnu.org> <878ruehx6n.fsf@yahoo.com> <83h791pmnl.fsf@gnu.org> <87iltheyeu.fsf@yahoo.com> <83wnhwol2o.fsf@gnu.org> <87tud0ybhj.fsf@yahoo.com> <837d9w450e.fsf@gnu.org> <87czjow7x1.fsf@yahoo.com> <8335kk440x.fsf@gnu.org> <87sfsjvdnm.fsf@yahoo.com> <87leybv8mp.fsf@yahoo.com> <87h78zv1hc.fsf@yahoo.com> <83fsoj2e7m.fsf@gnu.org> <87v8xfuh2z.fsf@yahoo.com> <83bkz72dhh.fsf@gnu.org> <87pmnnuflf.fsf@yahoo.com> <837d9v2axs.fsf@gnu.org> <877d9vudxy.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8213"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 16 15:08:28 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nKKyq-000239-KV for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Feb 2022 15:08:28 +0100 Original-Received: from localhost ([::1]:59350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKKyp-00038e-6p for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Feb 2022 09:08:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKKvy-0007oM-I4 for emacs-devel@gnu.org; Wed, 16 Feb 2022 09:05:31 -0500 Original-Received: from [2001:470:142:3::e] (port=53566 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKKvy-0000Zr-8c; Wed, 16 Feb 2022 09:05:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=VsoncRPFYnC3BzFf8N39NPWTUyNIFv+lC+wCB595Y0U=; b=JgK4/vGnfcef wZlOVg1VDZ0fAkF2PaC/LZ31inwIfGuqnuRIYOqdGwLfA3KkoFch5x6wP/Q//DbFQ1rr8xfSEvFEg 5C2G3K0IdXxNTSfz2LCQqEaCWG2XGjGROsFvngoByByF+bzUaFlEcTVfomRJ2/xWJZwT7kMDaZKPd apnuBy4uUH+p+ZPPQKId+Dgx7Ew3AiaDYB3iY+b1oddf4duhKtl5yrq0ZYcY+9Gg55r3IlgMSTAlm wOcU3fbaln1CiSvoDauE8cHWxgAgc5kXxb8eSSxfsJja8anv7YiJw1aoWhJLlCwaHZ0DNtjvBJcn/ gUIE4qUlNGx/vBQAgNoC+w==; Original-Received: from [87.69.77.57] (port=2132 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKKvx-0001Vr-NT; Wed, 16 Feb 2022 09:05:30 -0500 In-Reply-To: <877d9vudxy.fsf@yahoo.com> (message from Po Lu on Wed, 16 Feb 2022 21:40:57 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286392 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Wed, 16 Feb 2022 21:40:57 +0800 > > --- a/src/xterm.c > +++ b/src/xterm.c > @@ -8734,6 +8734,15 @@ handle_one_xevent (struct x_display_info *dpyinfo, > { > /* Decode the input data. */ > > +#ifdef HAVE_GLIB > + /* If this isn't done in a build with GLib (usually > + with GTK), then the resulting signal in > + `setup_coding_system' will cause Emacs to > + crash. */ > + if (NILP (Fcoding_system_p (coding_system))) > + goto done_keysym; > +#endif > + > /* The input should be decoded with `coding_system' > which depends on which X*LookupString function > we used just above and the locale. */ This isn't right, IMO. You should decode using Qraw_text in the problematic case. Dropping the bytes on the floor is too radical, certainly for the release branch.