aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2014-07-31 06:55:12 -0700
committerPaul Eggert2014-07-31 06:55:12 -0700
commitf3655f35ccd5a56c158a5db399c5f168b2e928d0 (patch)
treee6d0df24569c82f049fe15a6919edf4907f9c758 /src
parentdef546a8b82f60478c780bf3cbdbceedcf7a2ccd (diff)
downloademacs-f3655f35ccd5a56c158a5db399c5f168b2e928d0.tar.gz
emacs-f3655f35ccd5a56c158a5db399c5f168b2e928d0.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/frame.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b5c9e6d6b30..985e3b33e06 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12014-07-31 Paul Eggert <eggert@cs.ucla.edu>
2
3 * frame.c (x_set_frame_parameters): Don't use uninitialized locals.
4 Without this change, the code can access the local variable 'width'
5 even when it has not been initialized, and likewise for 'height';
6 in either case this leads to undefined behavior.
7
12014-07-30 Dmitry Antipov <dmantipov@yandex.ru> 82014-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2 9
3 * xrdb.c (x_load_resources) [USE_MOTIF]: Although not strictly 10 * xrdb.c (x_load_resources) [USE_MOTIF]: Although not strictly
diff --git a/src/frame.c b/src/frame.c
index fa9bdfcd065..1b9f818292f 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -3198,10 +3198,9 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
3198 3198
3199 XSETFRAME (frame, f); 3199 XSETFRAME (frame, f);
3200 3200
3201 if ((width_change || height_change) 3201 if (((width_change && width != FRAME_TEXT_WIDTH (f))
3202 && (width != FRAME_TEXT_WIDTH (f) 3202 || (height_change && height != FRAME_TEXT_HEIGHT (f)))
3203 || height != FRAME_TEXT_HEIGHT (f) 3203 && (f->new_height || f->new_width))
3204 || f->new_height || f->new_width))
3205 { 3204 {
3206 /* If necessary provide default values for HEIGHT and WIDTH. Do 3205 /* If necessary provide default values for HEIGHT and WIDTH. Do
3207 that here since otherwise a size change implied by an 3206 that here since otherwise a size change implied by an