~burhanilinux/+junk/plymouth

« back to all changes in this revision

Viewing changes to debian/patches/labelft-0003-ply-label-Don-t-crash-if-label-plugin-fails.patch

  • Committer: Juzer Dana
  • Date: 2024-01-14 13:03:08 UTC
  • Revision ID: juzerdana@gmail.com-20240114130308-urizjbjhjqmenga6
New Commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From: Fabian Vogt <fvogt@suse.com>
 
2
Date: Thu, 21 Jan 2016 10:39:21 +0100
 
3
Origin: vendor, https://build.opensuse.org/package/view_file/Base:System/plymouth/0003-fix_null_deref.patch
 
4
Forwarded: https://gitlab.freedesktop.org/plymouth/plymouth/-/merge_requests/91
 
5
Subject: [PATCH 4/7] ply-label: Don't crash if label plugin fails
 
6
 
 
7
The label plugin's create_control function can return NULL if allocation
 
8
failed, for example, but ply-label.c ignores that and uses the NULL control,
 
9
causing various SEGVs.
 
10
 
 
11
Signed-off-by: Fabian Vogt <fvogt@suse.com>
 
12
---
 
13
 src/libply-splash-graphics/ply-label.c | 9 +++++++++
 
14
 1 file changed, 9 insertions(+)
 
15
 
 
16
diff --git a/src/libply-splash-graphics/ply-label.c b/src/libply-splash-graphics/ply-label.c
 
17
index 703060a..2430ceb 100644
 
18
--- a/src/libply-splash-graphics/ply-label.c
 
19
+++ b/src/libply-splash-graphics/ply-label.c
 
20
@@ -130,6 +130,15 @@ ply_label_load_plugin (ply_label_t *label)
 
21
 
 
22
         label->control = label->plugin_interface->create_control ();
 
23
 
 
24
+        if (label->control == NULL) {
 
25
+                ply_save_errno ();
 
26
+                label->plugin_interface = NULL;
 
27
+                ply_close_module (label->module_handle);
 
28
+                label->module_handle = NULL;
 
29
+                ply_restore_errno ();
 
30
+                return false;
 
31
+        }
 
32
+
 
33
         if (label->text != NULL)
 
34
                 label->plugin_interface->set_text_for_control (label->control,
 
35
                                                                label->text);
 
36
-- 
 
37
2.34.1
 
38