From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud Newsgroups: gmane.emacs.bugs Subject: bug#58028: 29.0.50; Ensures no leakage of glyph_matrix Date: Sat, 24 Sep 2022 17:31:20 +0200 Message-ID: <87zgeon60n.fsf@elite.giraud> References: <87illenmjk.fsf@elite.giraud> <83sfkiozub.fsf@gnu.org> <87czbmnksr.fsf@elite.giraud> <83k05uoujl.fsf@gnu.org> <878rm9om7q.fsf@elite.giraud> <834jwxpbo3.fsf@gnu.org> <874jwxnk02.fsf@elite.giraud> <83czblned0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3976"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix) Cc: 58028@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 24 17:32:26 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 1oc78j-0000tX-Od for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Sep 2022 17:32:25 +0200 Original-Received: from localhost ([::1]:58020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oc78h-0000VW-1p for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Sep 2022 11:32:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oc78M-0000VM-Ss for bug-gnu-emacs@gnu.org; Sat, 24 Sep 2022 11:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45917) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oc78M-00030e-K6 for bug-gnu-emacs@gnu.org; Sat, 24 Sep 2022 11:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oc78M-0008DZ-Bg for bug-gnu-emacs@gnu.org; Sat, 24 Sep 2022 11:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Sep 2022 15:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58028 X-GNU-PR-Package: emacs Original-Received: via spool by 58028-submit@debbugs.gnu.org id=B58028.166403349031551 (code B ref 58028); Sat, 24 Sep 2022 15:32:02 +0000 Original-Received: (at 58028) by debbugs.gnu.org; 24 Sep 2022 15:31:30 +0000 Original-Received: from localhost ([127.0.0.1]:44995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc77p-0008Cp-PI for submit@debbugs.gnu.org; Sat, 24 Sep 2022 11:31:30 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:2195) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc77n-0008Cg-3t for 58028@debbugs.gnu.org; Sat, 24 Sep 2022 11:31:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=tHcEC4CXAkkSFNSW /5o1cOrXOk1vcaJ5IPGrukmhwWs=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=2VUnmL4OkelVD0p3D1NWmvmhweIVUC55paJHm4 7A6u18tgJJmMESDIpDEb3xU2MlD9qsR+gtLzeQsqKv95pYaGFCrc7ijjqu7JUPlpqOOC8F Xa+OI6Ko89cssKC7KZbe5cUBiXtbuWubIc+jjle/QBoke49IsJmogQ04H9Oz0+0gwray6H 01JnkuGSksT2fLz+Zn527NPf8aBlhBUySzzqBXfJWOnO6uf4GvfgKUiTGSHt0Ku9cVLDaj LhT239j6WsxFrtN5SaPk48a3aqUO4/4mXXSiyRb0554Agxm4RxytQ8zQhKHqL/Up/Wz7pG /8mabzYs/3BZjoV/6h0urUlg== Original-Received: from elite.giraud ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 7a43a585 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 24 Sep 2022 17:31:25 +0200 (CEST) In-Reply-To: <83czblned0.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 24 Sep 2022 15:31:07 +0300") 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:243547 Archived-At: --=-=-= Content-Type: text/plain So I've tested emacs -Q a bit (compiled with --enable-checking=all) with the attached patch. I had no error so far. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Ensures-no-leakage-of-glyph_matrix.patch >From 332ea1a172568a31f8e2ad0dcd921727d30dad68 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Fri, 23 Sep 2022 17:14:44 +0200 Subject: [PATCH] Ensures no leakage of glyph_matrix ; * src/dispnew.c (allocate_matrices_for_window_redisplay): Ensures no leakage of glyph_matrix. --- src/dispnew.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dispnew.c b/src/dispnew.c index b786f0f1ba..2568ba1086 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -1810,9 +1810,12 @@ allocate_matrices_for_window_redisplay (struct window *w) if (w->desired_matrix == NULL) { w->desired_matrix = new_glyph_matrix (NULL); - w->current_matrix = new_glyph_matrix (NULL); + eassert (w->current_matrix == NULL); } + if (w->current_matrix == NULL) + w->current_matrix = new_glyph_matrix (NULL); + dim.width = required_matrix_width (w); dim.height = required_matrix_height (w); adjust_glyph_matrix (w, w->desired_matrix, 0, 0, dim); -- 2.37.3 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=--