2016-02-08 17:17:25 +01:00
|
|
|
From 99ee02fe20ae53323fe5756416e6a7d96a3baf8a Mon Sep 17 00:00:00 2001
|
|
|
|
From: Fabian Vogt <fvogt@suse.com>
|
|
|
|
Date: Thu, 21 Jan 2016 10:39:21 +0100
|
|
|
|
Subject: [PATCH 1/3] ply-label: Don't crash if label plugin fails
|
|
|
|
|
|
|
|
The label plugin's create_control function can return NULL if allocation
|
|
|
|
failed, for example, but ply-label.c ignores that and uses the NULL control,
|
|
|
|
causing various SEGVs.
|
|
|
|
|
|
|
|
Signed-off-by: Fabian Vogt <fvogt@suse.com>
|
|
|
|
---
|
|
|
|
src/libply-splash-graphics/ply-label.c | 8 ++++++++
|
|
|
|
1 file changed, 8 insertions(+)
|
|
|
|
|
2018-08-18 16:07:40 +02:00
|
|
|
Index: plymouth-0.9.3+git20180807.7663b0c/src/libply-splash-graphics/ply-label.c
|
2016-02-08 17:17:25 +01:00
|
|
|
===================================================================
|
2018-08-18 16:07:40 +02:00
|
|
|
--- plymouth-0.9.3+git20180807.7663b0c.orig/src/libply-splash-graphics/ply-label.c 2018-08-17 19:58:59.703026810 +0200
|
|
|
|
+++ plymouth-0.9.3+git20180807.7663b0c/src/libply-splash-graphics/ply-label.c 2018-08-17 19:59:33.203397962 +0200
|
2016-02-08 17:17:25 +01:00
|
|
|
@@ -130,6 +130,15 @@ ply_label_load_plugin (ply_label_t *labe
|
|
|
|
|
|
|
|
label->control = label->plugin_interface->create_control ();
|
|
|
|
|
|
|
|
+ if (label->control == NULL) {
|
|
|
|
+ ply_save_errno ();
|
|
|
|
+ label->plugin_interface = NULL;
|
|
|
|
+ ply_close_module (label->module_handle);
|
|
|
|
+ label->module_handle = NULL;
|
|
|
|
+ ply_restore_errno ();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
if (label->text != NULL)
|
|
|
|
label->plugin_interface->set_text_for_control (label->control,
|
|
|
|
label->text);
|