]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Handle NULL boot_buffer
authorColin Watson <cjwatson@ubuntu.com>
Wed, 28 Apr 2010 12:31:39 +0000 (13:31 +0100)
committerRay Strode <rstrode@redhat.com>
Mon, 3 May 2010 14:00:38 +0000 (10:00 -0400)
boot_buffer may be NULL if plymouthd failed to attach to the console
session (e.g. if booting without an initramfs so /dev/pts isn't mounted
yet).  Handle this gracefully rather than segfaulting.

src/plugins/splash/details/plugin.c

index 05eddc61f78d15bea6cba56ebd0d80b54a6dfcf9..fd8d2b8e55df42776d2856bdbc49a5dd6fd37ba0 100644 (file)
@@ -250,9 +250,12 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
                                  detach_from_event_loop,
                                  plugin);
 
-  size = ply_buffer_get_size (boot_buffer);
+  if (boot_buffer)
+    {
+      size = ply_buffer_get_size (boot_buffer);
 
-  write_on_views (plugin, ply_buffer_get_bytes (boot_buffer), size);
+      write_on_views (plugin, ply_buffer_get_bytes (boot_buffer), size);
+    }
 
   return true;
 }