Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.1:Staging:C
plymouth
0001-seats-guard-against-NULL-terminal.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-seats-guard-against-NULL-terminal.patch of Package plymouth
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
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor