all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: "Óscar Fuentes" <ofv@wanadoo.es>
Cc: 35277-done@debbugs.gnu.org
Subject: bug#35277: 26.1.90; Non-assigned variable used in condition
Date: Mon, 15 Apr 2019 20:58:04 -0700	[thread overview]
Message-ID: <156ca2d6-22c1-993c-4210-fc797096ddc2@cs.ucla.edu> (raw)
In-Reply-To: <875zrgv6xh.fsf@telefonica.net>

[-- Attachment #1: Type: text/plain, Size: 77 bytes --]

Thanks for reporting that. I installed the attached patch into Emacs master.

[-- Attachment #2: 0001-Fix-uninit-var-in-widget.c.patch --]
[-- Type: text/x-patch, Size: 1621 bytes --]

From debaa72dd89eee0dffc930a7ccff742ca5a81d88 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 15 Apr 2019 20:53:13 -0700
Subject: [PATCH] Fix uninit var in widget.c

* src/widget.c (EmacsFrameQueryGeometry):
Avoid use of uninitialized variables ok_width, ok_height (Bug#35277).
---
 src/widget.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/widget.c b/src/widget.c
index 508974dd46..e662dd3ecd 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -434,21 +434,20 @@ EmacsFrameResize (Widget widget)
 }
 
 static XtGeometryResult
-EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result)
+EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request,
+			 XtWidgetGeometry *result)
 {
-  EmacsFrame ew = (EmacsFrame) widget;
-
   int mask = request->request_mode;
-  Dimension ok_width, ok_height;
 
-  if (mask & (CWWidth | CWHeight))
+  if (mask & (CWWidth | CWHeight) && !frame_resize_pixelwise)
     {
-      if (!frame_resize_pixelwise)
-	round_size_to_char (ew,
-			    (mask & CWWidth) ? request->width : ew->core.width,
-			    ((mask & CWHeight) ? request->height
-			     : ew->core.height),
-			    &ok_width, &ok_height);
+      EmacsFrame ew = (EmacsFrame) widget;
+      Dimension ok_width, ok_height;
+
+      round_size_to_char (ew,
+			  mask & CWWidth ? request->width : ew->core.width,
+			  mask & CWHeight ? request->height : ew->core.height,
+			  &ok_width, &ok_height);
       if ((mask & CWWidth) && (ok_width != request->width))
 	{
 	  result->request_mode |= CWWidth;
-- 
2.17.1


      reply	other threads:[~2019-04-16  3:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-14 17:21 bug#35277: 26.1.90; Non-assigned variable used in condition Óscar Fuentes
2019-04-16  3:58 ` Paul Eggert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=156ca2d6-22c1-993c-4210-fc797096ddc2@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=35277-done@debbugs.gnu.org \
    --cc=ofv@wanadoo.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.