Skip to content

Commit

Permalink
pantheon.elementary-greeter: actually fix the crash
Browse files Browse the repository at this point in the history
Fixed a use-after-free issue where logged_in_context is used in update_style().
There are several reports for this but upstream has no action for this so far during the 6.x cycle.
See the provided link for more details.
  • Loading branch information
bobby285271 committed Feb 14, 2022
1 parent 2a376bb commit f29955d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ stdenv.mkDerivation rec {
src = ./hardcode-fallback-background.patch;
default_wallpaper = "${nixos-artwork.wallpapers.simple-dark-gray.gnomeFilePath}";
})
# https://github.com/NixOS/nixpkgs/issues/151609
# https://github.com/elementary/greeter/issues/578#issuecomment-1030746697
./fix-crash.patch
# Fix build with meson 0.61
# https://github.com/elementary/greeter/pull/590
(fetchpatch {
Expand Down
21 changes: 21 additions & 0 deletions pkgs/desktops/pantheon/desktop/elementary-greeter/fix-crash.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/src/Cards/UserCard.vala b/src/Cards/UserCard.vala
index 83df22c..8cd917e 100644
--- a/src/Cards/UserCard.vala
+++ b/src/Cards/UserCard.vala
@@ -42,6 +42,7 @@ public class Greeter.UserCard : Greeter.BaseCard {
private Gtk.Stack login_stack;
private Greeter.PasswordEntry password_entry;

+ private SelectionCheck logged_in;
private unowned Gtk.StyleContext logged_in_context;
private weak Gtk.StyleContext main_grid_style_context;
private weak Gtk.StyleContext password_entry_context;
@@ -214,7 +215,7 @@ public class Greeter.UserCard : Greeter.BaseCard {
};
avatar_overlay.add (avatar);

- var logged_in = new SelectionCheck () {
+ logged_in = new SelectionCheck () {
halign = Gtk.Align.END,
valign = Gtk.Align.END
};

0 comments on commit f29955d

Please sign in to comment.