From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dick Newsgroups: gmane.emacs.bugs Subject: bug#56372: 29.0.50; [PATCH] Avoid BadMatch X11 error Date: Mon, 04 Jul 2022 00:50:09 -0400 Message-ID: <87r131fpmm.fsf@dick> References: <87czemtfv0.fsf@dick> Mime-Version: 1.0 Content-Type: text/x-diff Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28438"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.14 (Gnus v5.14) Commercial/29.0.50 (gnu/linux) To: 56372@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 04 10:30:51 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1o8HTm-0007DR-RW for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Jul 2022 10:30:50 +0200 Original-Received: from localhost ([::1]:36696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8HTk-0008U8-Do for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Jul 2022 04:30:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8HT1-0008Sx-H4 for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2022 04:30:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52117) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8HT1-0003or-6M for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2022 04:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o8HT0-0003UA-R7 for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2022 04:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: dick Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Jul 2022 08:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56372 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 56372-submit@debbugs.gnu.org id=B56372.165692336813330 (code B ref 56372); Mon, 04 Jul 2022 08:30:02 +0000 Original-Received: (at 56372) by debbugs.gnu.org; 4 Jul 2022 08:29:28 +0000 Original-Received: from localhost ([127.0.0.1]:46014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8HSO-0003Sr-1F for submit@debbugs.gnu.org; Mon, 04 Jul 2022 04:29:28 -0400 Original-Received: from mail-qk1-f176.google.com ([209.85.222.176]:39569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8E2K-00045x-Jk for 56372@debbugs.gnu.org; Mon, 04 Jul 2022 00:50:20 -0400 Original-Received: by mail-qk1-f176.google.com with SMTP id b133so6092276qkc.6 for <56372@debbugs.gnu.org>; Sun, 03 Jul 2022 21:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:in-reply-to:references:date:message-id:user-agent :mime-version:content-disposition; bh=cfT3+ChFwHpZ9rIZ5mODCRIUHcXYywYyRJ2wF/rVsJo=; b=lIT4hplUhp/mlbidXlKJbkIphTccPL8OlTpqKkJM+wIf0+2RgocZe0J9D3V9pN9E5f yAg78Tv/3yUllftDTkCfSFMZIuYBlHCsvhO5i2KlsATqC0nd0MDxRVSxCbE8VDxoE3Hg k3SDKiXGZFLsiq9XNnTYucXxN095K7fhKq+l2whYfiv/fcNDZkpPft1WfUWU4aJlSYMh A3c+D2YVk2KDYLytcHCBwcHb4gc9ROgr+q2BJY6+Z6XdcgswQPDzwVsnsYLzPz88/6N4 rd7VZdExB+Z+19budR5XRThE2GqlMYUVzmsTvBxKBEaP/oAmU59dI0vPlPwaSwX+d6n9 N6fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:user-agent:mime-version:content-disposition; bh=cfT3+ChFwHpZ9rIZ5mODCRIUHcXYywYyRJ2wF/rVsJo=; b=mJlCVwePADBa3ZDpACcoU0m8U9ZVod7d9b4ZiPyny964Or28tPHHEuXzaXMMQX//Fd wZztiyEqWPiEHNgEnRptiYBwp/8nvqAbFV5z5Eg9SEDuSrR2fNu8KQi1oIbADtY9iNvo C/q9PEC2VomXxWAJojzzlvsI0MFblWwV14kUF/sScbrus8GVUGAY++PHJwoTWzDifjNG GSUCGJousp7oM3ak5YndRKiuk05Rf46qzlJVWQ9FRXQgS7wQtomr306RaPh5/ptUpg7e jEp7Kj9pBLq3/oXxiD8Ob/XVKousXHBxi/npON0PN8dMAVmYnSMCZ9gs+5g994VlzfQG +qFg== X-Gm-Message-State: AJIora8hlD/JT71LF0LIe9QTdqq7AA3Iox6E/d+lSAXrs0Gu9IOvwucj CJ/pUKAUd7Oa2+idxVGEcDDsoUf37gA= X-Google-Smtp-Source: AGRyM1sua2FoRJFeA1nAjJotPSoJwx+HtXubwzRfHK+g4xiJ8e/VxSPM1JWDSvAq+ULx2MfuE15bZQ== X-Received: by 2002:a05:620a:4843:b0:6ae:e906:ea49 with SMTP id ec3-20020a05620a484300b006aee906ea49mr18461168qkb.744.1656910210858; Sun, 03 Jul 2022 21:50:10 -0700 (PDT) Original-Received: from localhost (ool-457830b3.dyn.optonline.net. [69.120.48.179]) by smtp.gmail.com with ESMTPSA id x19-20020ac87ed3000000b0031bf4dd8a39sm11338218qtj.56.2022.07.03.21.50.09 for <56372@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 21:50:10 -0700 (PDT) In-Reply-To: <87czemtfv0.fsf@dick> (dick r. chiang's message of "Sun, 03 Jul 2022 10:45:07 -0400") Content-Disposition: inline; filename=0001-Avoid-segfault.patch X-Mailman-Approved-At: Mon, 04 Jul 2022 04:29:22 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:236036 Archived-At: >From 5d2442a836a5641f8f1c2b4a844fe510a77bd8c5 Mon Sep 17 00:00:00 2001 From: dickmao Date: Mon, 4 Jul 2022 00:47:34 -0400 Subject: [PATCH] Avoid segfault * src/xterm.c (x_connection_closed): Avoid segfault. --- src/xterm.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index c5acb450837..464887da975 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -23518,17 +23518,18 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror) fprintf (stderr, "X error handlers currently installed:\n"); - for (failable = dpyinfo->failable_requests; - failable < dpyinfo->next_failable_request; - ++failable) - { - if (failable->end) - fprintf (stderr, "Ignoring errors between %lu to %lu\n", - failable->start, failable->end); - else - fprintf (stderr, "Ignoring errors from %lu onwards\n", - failable->start); - } + if (dpyinfo) + for (failable = dpyinfo->failable_requests; + failable < dpyinfo->next_failable_request; + ++failable) + { + if (failable->end) + fprintf (stderr, "Ignoring errors between %lu to %lu\n", + failable->start, failable->end); + else + fprintf (stderr, "Ignoring errors from %lu onwards\n", + failable->start); + } for (stack = x_error_message; stack; stack = stack->prev) fprintf (stderr, "Trapping errors from %lu\n", -- 2.36.1