]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
ply-console-viewer: Don't crash if passed a NULL format
authorRay Strode <rstrode@redhat.com>
Mon, 18 Dec 2023 13:52:00 +0000 (08:52 -0500)
committerRay Strode <rstrode@redhat.com>
Mon, 18 Dec 2023 18:57:10 +0000 (13:57 -0500)
The splash plugins currently call

ply_console_viewer_print (... NULL);

if no prompt message is specified... This leads to crash.

Rather than fixing all the splash plugins, this commit just makes
a NULL format be a noop.

src/libply-splash-graphics/ply-console-viewer.c

index 8e1ee6288ad5b2eca2d8c7582e423e823fbf782d..dbcf3eca627f24c3b7caa66dfc8e9b5fa1f1f1d9 100644 (file)
@@ -341,6 +341,9 @@ ply_console_viewer_print (ply_console_viewer_t *console_viewer,
         char *buffer = NULL;
         int length;
 
+        if (format == NULL)
+                return;
+
         va_start (arguments, format);
         length = vsnprintf (NULL, 0, format, arguments);
         if (length > 0)