FLTK logo

[master] 2a3b4e1 - Wayland: fix issue #492 "Use after free()".

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 2a3b4e1 - Wayland: fix issue #492 "Use after free()". "ManoloFLTK" Sep 02, 2022  
 
commit 2a3b4e1f2d272ccc88c8a99121d3ca7f9414e3ed
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Fri Sep 2 09:35:44 2022 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Fri Sep 2 09:35:44 2022 +0200

    Wayland: fix issue #492 "Use after free()".

 libdecor/src/plugins/cairo/libdecor-cairo.c | 4 +++-
 libdecor/src/plugins/gtk/libdecor-gtk.c     | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git libdecor/src/plugins/cairo/libdecor-cairo.c libdecor/src/plugins/cairo/libdecor-cairo.c
index 155a495..d58c1f8 100644
--- libdecor/src/plugins/cairo/libdecor-cairo.c
+++ libdecor/src/plugins/cairo/libdecor-cairo.c
@@ -2374,8 +2374,10 @@ pointer_button(void *data,
 					toggle_maximized(&frame_cairo->frame);
 					break;
 				case BUTTON_CLOSE:
-					if (closeable(frame_cairo))
+                                        if (closeable(frame_cairo)) {
 						libdecor_frame_close(&frame_cairo->frame);
+                                                return;
+                                        }
 					break;
 				default:
 					break;
diff --git libdecor/src/plugins/gtk/libdecor-gtk.c libdecor/src/plugins/gtk/libdecor-gtk.c
index 53cc813..3447747 100644
--- libdecor/src/plugins/gtk/libdecor-gtk.c
+++ libdecor/src/plugins/gtk/libdecor-gtk.c
@@ -2221,9 +2221,11 @@ pointer_button(void *data,
 					toggle_maximized(&frame_gtk->frame);
 					break;
 				case HEADER_CLOSE:
-					if (closeable(frame_gtk))
+                                        if (closeable(frame_gtk)) {
 						libdecor_frame_close(
 							&frame_gtk->frame);
+                                                return;
+                                        }
 					break;
 				default:
 					break;
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.