Marcus Meissner
d25a97433e
- Add 0001-splash-remove-pixel_pixel-in-sprite-lib-when-notifie.patch: fix crash when pixel_display is removed. - Add 0001-device-manager-only-call-ply_terminal_free.patch: fix crash. - Add use-mkinitrd.patch: call mkinitrd -B, not dracut for now, otherwise initramfs is being created by plymouth-update-initrd, not initrd file. - Ensure we don't rebuild initrd twice when updating plymouth. - Ensure default theme is SLE/openSUSE (based on %suse_version) OBS-URL: https://build.opensuse.org/request/show/238080 OBS-URL: https://build.opensuse.org/package/show/Base:System/plymouth?expand=0&rev=146
95 lines
2.8 KiB
Diff
95 lines
2.8 KiB
Diff
From a6eff09852c2eb4d684526b814d2b2df578938d0 Mon Sep 17 00:00:00 2001
|
|
From: Frederic Crozat <fcrozat@suse.com>
|
|
Date: Thu, 12 Jun 2014 18:51:24 +0200
|
|
Subject: [PATCH] seats: guard against NULL terminal
|
|
|
|
---
|
|
src/libply-splash-core/ply-keyboard.c | 7 +++++--
|
|
src/libply-splash-core/ply-seat.c | 6 +++---
|
|
src/libply-splash-core/ply-terminal.c | 11 +++++++----
|
|
3 files changed, 15 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/src/libply-splash-core/ply-keyboard.c b/src/libply-splash-core/ply-keyboard.c
|
|
index 624f906..1bed19f 100644
|
|
--- a/src/libply-splash-core/ply-keyboard.c
|
|
+++ b/src/libply-splash-core/ply-keyboard.c
|
|
@@ -423,8 +423,11 @@ ply_keyboard_free (ply_keyboard_t *keyboard)
|
|
}
|
|
else
|
|
{
|
|
- ply_buffer_free (keyboard->provider.if_terminal->key_buffer);
|
|
- free (keyboard->provider.if_terminal);
|
|
+ if (keyboard->provider.if_terminal)
|
|
+ {
|
|
+ ply_buffer_free (keyboard->provider.if_terminal->key_buffer);
|
|
+ free (keyboard->provider.if_terminal);
|
|
+ }
|
|
}
|
|
|
|
free (keyboard);
|
|
diff --git a/src/libply-splash-core/ply-seat.c b/src/libply-splash-core/ply-seat.c
|
|
index 2ac8bf7..29e2dfa 100644
|
|
--- a/src/libply-splash-core/ply-seat.c
|
|
+++ b/src/libply-splash-core/ply-seat.c
|
|
@@ -102,12 +102,12 @@ add_text_displays (ply_seat_t *seat)
|
|
{
|
|
ply_text_display_t *display;
|
|
|
|
- if (!ply_terminal_is_open (seat->terminal))
|
|
+ if (!seat->terminal || !ply_terminal_is_open (seat->terminal))
|
|
{
|
|
- if (!ply_terminal_open (seat->terminal))
|
|
+ if (!seat->terminal || !ply_terminal_open (seat->terminal))
|
|
{
|
|
ply_trace ("could not add terminal %s: %m",
|
|
- ply_terminal_get_name (seat->terminal));
|
|
+ seat->terminal ? ply_terminal_get_name (seat->terminal) : "none" );
|
|
return;
|
|
}
|
|
}
|
|
diff --git a/src/libply-splash-core/ply-terminal.c b/src/libply-splash-core/ply-terminal.c
|
|
index 992dd3f..b52b108 100644
|
|
--- a/src/libply-splash-core/ply-terminal.c
|
|
+++ b/src/libply-splash-core/ply-terminal.c
|
|
@@ -654,30 +654,33 @@ ply_terminal_open (ply_terminal_t *terminal)
|
|
int
|
|
ply_terminal_get_fd (ply_terminal_t *terminal)
|
|
{
|
|
- return terminal->fd;
|
|
+ return terminal ? terminal->fd : -1;
|
|
}
|
|
|
|
bool
|
|
ply_terminal_is_vt (ply_terminal_t *terminal)
|
|
{
|
|
- return terminal->vt_number > 0;
|
|
+ return terminal ? terminal->vt_number > 0 : false;
|
|
}
|
|
|
|
bool
|
|
ply_terminal_is_open (ply_terminal_t *terminal)
|
|
{
|
|
- return terminal->is_open;
|
|
+ return terminal ? terminal->is_open : false;
|
|
}
|
|
|
|
bool
|
|
ply_terminal_is_active (ply_terminal_t *terminal)
|
|
{
|
|
- return terminal->is_active;
|
|
+ return terminal ? terminal->is_active : false;
|
|
}
|
|
|
|
void
|
|
ply_terminal_close (ply_terminal_t *terminal)
|
|
{
|
|
+ if (!terminal)
|
|
+ return;
|
|
+
|
|
if (!terminal->is_open)
|
|
{
|
|
ply_trace ("terminal %s is already closed", terminal->name);
|
|
--
|
|
1.8.4.5
|
|
|