Subject: 26.1.90; Non-assigned variable used in condition
From: Paul Eggert <[email-masked]>
To: Óscar Fuentes <[email-masked]>
Cc: [email-masked]
Date: Mon, 15 Apr 2019 20:58:04 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Thanks for reporting that. I installed the attached patch into Emacs master.
From debaa72dd89eee0dffc930a7ccff742ca5a81d88 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
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