emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117615: * frame.c (x_set_frame_parameters): Don't u


From: Paul Eggert
Subject: [Emacs-diffs] trunk r117615: * frame.c (x_set_frame_parameters): Don't use uninitialized locals.
Date: Thu, 31 Jul 2014 13:55:18 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117615
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Thu 2014-07-31 06:55:12 -0700
message:
  * frame.c (x_set_frame_parameters): Don't use uninitialized locals.
  
  Without this change, the code can access the local variable 'width'
  even when it has not been initialized, and likewise for 'height';
  in either case this leads to undefined behavior.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/frame.c                    frame.c-20091113204419-o5vbwnq5f7feedwu-243
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-07-30 04:03:45 +0000
+++ b/src/ChangeLog     2014-07-31 13:55:12 +0000
@@ -1,3 +1,10 @@
+2014-07-31  Paul Eggert  <address@hidden>
+
+       * frame.c (x_set_frame_parameters): Don't use uninitialized locals.
+       Without this change, the code can access the local variable 'width'
+       even when it has not been initialized, and likewise for 'height';
+       in either case this leads to undefined behavior.
+
 2014-07-30  Dmitry Antipov  <address@hidden>
 
        * xrdb.c (x_load_resources) [USE_MOTIF]: Although not strictly

=== modified file 'src/frame.c'
--- a/src/frame.c       2014-07-29 08:51:49 +0000
+++ b/src/frame.c       2014-07-31 13:55:12 +0000
@@ -3198,10 +3198,9 @@
 
     XSETFRAME (frame, f);
 
-    if ((width_change || height_change)
-        && (width != FRAME_TEXT_WIDTH (f)
-            || height != FRAME_TEXT_HEIGHT (f)
-            || f->new_height || f->new_width))
+    if (((width_change && width != FRAME_TEXT_WIDTH (f))
+        || (height_change && height != FRAME_TEXT_HEIGHT (f)))
+       && (f->new_height || f->new_width))
       {
        /* If necessary provide default values for HEIGHT and WIDTH.  Do
           that here since otherwise a size change implied by an


reply via email to

[Prev in Thread] Current Thread [Next in Thread]