plymouth/0003-fix_null_deref.patch
Cliff Zhao 1799fdbb0d Accepting request 975514 from home:qzhao:branches:Base:System
1. Add plymouth-log-on-default.patch: Enable plymouth log by default, help to resolve random appear problems (bsc#1193736). 2. Pick back patch information for label-ft.

OBS-URL: https://build.opensuse.org/request/show/975514
OBS-URL: https://build.opensuse.org/package/show/Base:System/plymouth?expand=0&rev=316
2022-05-07 06:16:07 +00:00

37 lines
1.6 KiB
Diff

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(+)
Index: plymouth-0.9.2/src/libply-splash-graphics/ply-label.c
===================================================================
diff -Nura plymouth-0.9.5+git20200921+20778f2/src/libply-splash-graphics/ply-label.c plymouth-0.9.5+git20200921+20778f2_new/src/libply-splash-graphics/ply-label.c
--- plymouth-0.9.5+git20200921+20778f2/src/libply-splash-graphics/ply-label.c 2020-10-05 23:11:23.011964608 +0800
+++ plymouth-0.9.5+git20200921+20778f2_new/src/libply-splash-graphics/ply-label.c 2020-10-05 23:17:39.139340680 +0800
@@ -130,6 +130,15 @@
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);